Go Dedecms methods for calling other variables in the runphp tag

Source: Internet
Author: User

Dedecms methods for calling other variables in the runphp tag

As we all know, in the dedecms can use PHP, the common method is if else, for example, in template production, we need to judge the source and author, if it is empty, then prompt: No or unknown, sample:

{Dede:field name= ' source ' runphp= ' yes '}
if (@me = = "") @me = "" or else @me = "Source:" [email protected];
{/dede:field}

But what if you want to call other variables in the code above? This afternoon, the fire small series encountered this problem, in the Weave Dream Official forum looked for a bit, now the method is published as follows, we will write the variable as Universal: Array, the code is as follows:

{Dede:field name= ' array ' runphp= ' yes '}if (@me [' source '] = = ') @me = "@me [' Other variables ']"; else @me = "Source:" [email protected][' Sour Ce ']; {/dede:field}

Fire NET original article, please indicate the link when reprinted.

Go Dedecms methods for calling other variables in the runphp tag

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.