Home > CMS Tutorial > DEDECMS > body text

How to use dedecms tag in your own php page

藏色散人
Release: 2019-12-25 09:39:38
Original
2290 people have browsed it

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();//显示该页面
?>
Copy after login

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}
Copy after login

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!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!