How to use the dedecms tag in your own php page?
This article mainly introduces code examples for using dedecms tags in your own PHP pages. Friends in need can refer to it
Recommended learning: 梦Weavercms
Step 1: Add the following code to the external php page:
<? require_once (dirname(__FILE__).'/../include/common.inc.php');//包含配置文件 require_once DEDEINC.'/arc.partview.class.php';//包含partiew类 $tempfile = 'news.htm';//定义模板路径 $pv = new PartView();//初始化类 $pv->SetTemplet($tempfile);//设定模板文件路径 $pv->Display();//显示该页面 ?>
Step 2: Create a template file (news.htm) and add dedecms tag code, for example, the following code calls the website Titles and links of the first ten articles in column id=1:
Copy code
The code is as follows:
{dede:arclist orderby=id orderway=desc typeid=1 limit='0,10' }</p> <p><li><a href="[field:arcurl/]">[field:title/]</a></li></p> <p>{/dede:arclist}
Through the above two steps, it can be achieved The external PHP page calls the target data through the dedecms tag code.
The above is the detailed content of How to use dedecms tag in your own php page. For more information, please follow other related articles on the PHP Chinese website!