Home > Backend Development > PHP Tutorial > How to define global variables like dedecms?

How to define global variables like dedecms?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-04 09:20:17
Original
1205 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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template