Home >Backend Development >PHP Tutorial >thinkphp栏目治理

thinkphp栏目治理

WBOY
WBOYOriginal
2016-06-13 10:36:491085browse

thinkphp栏目管理

后台代码:


 $this->mokuai('mokuai',类别的数字号码);
        
        if(isset($_GET['lawid'])){
        
          $this->mokuaixi('mokuai',$_GET['lawid']);
        }


//自己封装的方法

    function mokuai($chart='',$pid=''){
      $user=D($chart);
      
       $list=$user->where("products_category=".$pid."")->select();
           //thumbRemoveOrigin
       
           $this->assign("mokuai",$list);
       
       }
   function mokuaixi($chart='',$pid=''){
      $user=D($chart);
      
       $list=$user->where("products_id=".$pid."")->select();
           //thumbRemoveOrigin
       
           $this->assign("mokuaixi",$list);
       
       }



前台显示

导航栏:

 
          

  • {$vo.products_name}


  • 与导航栏对应的内容

     
      


        

    {$vo.products_name}

    发布时间:{$vo.products_uptime}


       

    {$vo.products_content}
          
     

         
          
         


     


    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn