Home>Article>Backend Development> How to write php code in phpcms?

How to write php code in phpcms?

coldplay.xixi
coldplay.xixi Original
2020-07-14 13:34:36 2249browse

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. .

How to write php code in phpcms?

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!

Statement:
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