Home >Backend Development >PHP Problem >How to write php code in phpcms?
How to write php code in phpcms: 1. Use the [{php;}] tag, followed by a sentence of php code; 2. The template file of phpcms is included through include, so it is possible to directly use the native php statement. .
phpcms method of writing php code:
1. Use the php tag provided by phpcms
{php $i=1;} {php $i++;} {php echo $i;}
Use the {php ;}
tag, followed by a php code.
2. Directly use PHP code statements
The template file of phpcms is included through include, so it is also possible to directly use PHP native statements. Use the template tag that comes with phpcms. Due to its inflexibility, slightly more complex logic requires the use of PHP native code statements. Therefore, it is very convenient to use PHP code statements directly in templates.
Related learning recommendations: phpcms tutorial
The above is the detailed content of How to write php code in phpcms?. For more information, please follow other related articles on the PHP Chinese website!