In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to add php code to the dream weaving dede template. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.
Dream weaving dede template how to add php code?
1. Embed php in the template page
Recommended study: dream weaving cms
For example:
{dede:name runphp='yes'} $str = "hello"; @ me = $str; @ me. = "world" {/ dede:name}
The final output is hello world
In fact, "name" is an arbitrarily defined name, and the value after "@ me=" is the final value for output, so I'll use it instead of echo. (if you directly use echo, an error is reported when the template is generated, which is the limit, alas).
Second, quote php files
If you want to use PHP in include files, add source='value'
{dede:include runphp='yes' source='value' file=''/}
The specifications written by PHP are:
There is no need to add symbols in PHP coding.
Second, if you want to deal with the value of the current tag (the first case above), use @ me to indicate the current value
Third, if you directly introduce PHP and want to get the running value, you must use $DedeMeValue to represent the final value returned after running the PHP (so you can't use HTML mixed writing).
For example:
{dede:field runphp='yes'} $aaa=200;$DedeMeValue=100;$DedeMeValue + = $aaa; {/ dede:field}
Equivalent to:
{dede:field runphp='yes'} $aaa = 200 aaa;; metrology 100 percent me + = $aaa;; {/ dede:field}
The final returned result is: 300
For example: {dede:list perpage='10'}
[field:id runphp= "yes"] $dsql = new DedeSql (false); $a = "select a.address FROM xudaoshan_addonarticle as a where a.aid=@me"; $arcRow = $dsql- > GetOne ($a); @ me=''.$ arcRow.'; [/ field:id] {/ dede:list} Thank you for reading! On the dream weaving dede template to add php code to share here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.