Home  >  Article  >  Backend Development  >  Classification name and category name calling of phpcms

Classification name and category name calling of phpcms

怪我咯
怪我咯Original
2017-07-04 14:19:472448browse

This article mainly introduces the category name and category name calling of phpcms. It has certain reference value. Let’s take a look at it with the editor.

Without further ado, please look at the code:

//在需要调用的模板前写这句代码,$CATEGORYS 代表分类,$TYPE 代表类别(没有这句话,调不出来)
{php $CATEGORYS = getcache('category_content_'.$siteid,'commons');$TYPE = getcache('type_content','commons');}

//调用
{$TYPE[$typeid]['name']}      //$typeid代表分类的id(在后台可以看到)
{$CATEGORYS[$catid][catname]}  //$catid代表分类的id(在后台可以看到)

//通过子栏目的id获取父类的id和名称
父栏目id:{$CATEGORY[$catid][parentid]}
父栏目名称:{$CATEGORYS[$CAT[parentid]][catname]}

The above is the detailed content of Classification name and category name calling of phpcms. For more information, please follow other related articles on the PHP Chinese website!

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