SetTemplet($tempfile);" to the external PHP page; then create a template file and add the "dedecms" tag code."/> SetTemplet($tempfile);" to the external PHP page; then create a template file and add the "dedecms" tag code.">

Home  >  Article  >  CMS Tutorial  >  How to use dedecms tag in your own php page

How to use dedecms tag in your own php page

藏色散人
藏色散人Original
2019-12-25 09:39:382288browse

How to use dedecms tag in your own php page

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__).&#39;/../include/common.inc.php&#39;);//包含配置文件
require_once DEDEINC.&#39;/arc.partview.class.php&#39;;//包含partiew类
$tempfile = &#39;news.htm&#39;;//定义模板路径
$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=&#39;0,10&#39; }</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!

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