How to call sub-column from V9 parent column_PHP tutorial

WBOY
Release: 2016-07-20 11:13:15
Original
1141 people have browsed it

我们在做模板时有时候需要用到调用栏目的子栏目,下面这个文章将教大家实现目的,挺简单的。代码如下:

调用:

   
    {php $j=1;}
    {loop subcat($parentid) $v}
    {php if($v['type']!=0) continue;}
        [{$v[catname]}]
    {/loop}
   

调用 [或1级栏目的专题页面]:


   
    {php $j=1;}     {loop subcat($catid) $v}
    {php if($v['type']!=0) continue;}
        [{$v[catname]}]
    {/loop}
  



PS: When calling , you can also call it like this:
{pc:content action="category" catid="$parentid" num="25" siteid="$siteid" order="listorder ASC"}
                    {loop $data $r}
                                                                                                                                                                                                               {/loop}
                  {/pc}

The parameters are as follows:

字段 类型 默认值  说明 
smallint  栏目ID
tinyint(3)  0  站点ID
varchar(15)    模块ID
tinyint(1)  1  栏目类型ID
tinyint(5)  5  模型ID
smallint(5)  5  上级父栏目
varchar(255)    所有父栏目
tinyint(1)  0  子栏目
mediumtext    所有子栏目
varchar(30)    栏目名称
varchar(100)    栏目图片
mediumtext    栏目描述
varchar(100)    父栏目目录
varchar(30)    栏目目录
varchar(100)    栏目链接
mediumint(8)  0  栏目内容数
int(10)  0  点击数
mediumtext    栏目设置
smallint(5)  0  排序
tinyint(1)  0  是否显示
tinyint(1)  0  是否生成到根目录
varchar(30)    栏目拼音

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440388.htmlTechArticleWhen making templates, we sometimes need to use the sub-column of the calling column. The following article will teach you how to achieve the goal , quite simple. The code is as follows: In call: !-- * Get sub-column...
source:php.cn
Previous article:Some practical uses of Vim_PHP tutorial Next article:PHP development configuration under Ubuntu (new redis, sphinx, sqlserver related configuration)_PHP tutorial
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
Latest Articles by Author
Latest Issues
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!