The application of dedecms PHP syntax in template

Source: Internet
Author: User

Dede CMS Template Application php syntax method

{dede:field.test_go Php=yes}//test_go variable variable variables to be judged by itself

if (@me = = "" | | Empty (@me))//To determine whether an empty @me can be assigned to judge if it is empty to perform the next step,

@me = "None"//the @me here is equivalent to the echo in PHP for content output

{/dede:field.teest_go}//To end

Loading the content template

{Dede:field.text_go Runphp=yes}//runphp=yes means {dede:field.text_go} to run PHP program

if (@me <> ") @me =" ";//if there is something in the teext_go output this, support the HTML code, and you can use @me in your code to invoke the text _go Field

Else

@me = ""; If not, execute the following sentence

{/dede:field.audio}

Added a new function to Dede template if judging function label IIf Elserun

Add variable $str and $str _count $str is the final display $str _count is the number of loops displayed

Added the label IIF and Elserun meet IIF conditions to run normally if dissatisfied with IIF's conditions run Elserun
If the IIF condition is not met and no elserun is specified, the blank is returned

{dede:arclist orderby= "click" iif== "$str _count>1" elserun= "" $str = "temporarily no Content"}

. [field:textlink/]

{/dede:arclist}

?? Explain

Dede:arclist is a common list label for Dede

ORDER BY = "Click" Specifies how many times the almost

IIf to determine whether $str_count >1 meet the requirements are not satisfied with the output $str= "temporarily no content"

The application of dedecms PHP syntax in template

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.