How to define global variables like dedecms?

WBOY
Release: 2016-08-04 09:20:17
Original
1180 people have browsed it

As shown below, where is the $arc object defined?

<code>{dede:php}$GLOBALS['变量名']=$arc->Fields['fieldname']{/dede:php}</code>
Copy after login
Copy after login

The application scenario is to determine the output when a field is empty, in which other fields need to be called:
{dede:field.Field name runphp='yes'}
if(@me =='')
{
@me= 'Output result when the value is empty';
}
else
{
@me=@me;
}
{/dede:field.field name}

Reply content:

As shown below, where is the $arc object defined?

<code>{dede:php}$GLOBALS['变量名']=$arc->Fields['fieldname']{/dede:php}</code>
Copy after login
Copy after login

The application scenario is to determine the output when a certain field is empty, in which other fields need to be called:
{dede:field.Field name runphp='yes'}
if(@me =='')
{
@me= 'Output result when the value is empty';
}
else
{
@me=@me;
}
{/dede:field.field name}

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