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

thinkphp栏目治理

WBOY
Release: 2016-06-13 13:16:30
Original
933 people have browsed it

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}
          
     

         
          
         


     


    Related labels:
    source:php.cn
    Statement of this Website
    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
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template