Home > CMS Tutorial > DEDECMS > body text

What is the dede:php tag?

藏色散人
Release: 2019-11-15 10:32:17
Original
2950 people have browsed it

What is the dede:php tag?

dede:php标签是什么?

dede:php标签简介

dede的标签虽然强大,但是很多功能还是无法很好的实现。此时可以使用其PHP标签,即在模板中写PHP语句来得到任何自己想要的东西。

标签名称:{dede:php} {/dede:php}

举2个小例子来证明其可以做任何事情:

1.输出1-100

{dede:php}
for($i=0;$i<100;$i++){
    echo $i.&#39;&#39;;
}
{/dede:php}
Copy after login

2.输出当前页面所在的顶级栏目名称

{dede:php}
if($refObj->Fields[&#39;reid&#39;]==0){
echo $refObj->Fields[&#39;title&#39;];
}else{
$reid = $refObj->Fields[&#39;reid&#39;];
$row=$dsql->GetOne(&#39;SELECT id,reid,typename from jifu_arctype where id = &#39;.$reid);
echo $row[&#39;typename&#39;];
}
{/dede:php}
Copy after login

The above is the detailed content of What is the dede:php tag?. 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