How to write php code in phpcms?

coldplay.xixi
Release: 2023-03-02 15:00:01
Original
2363 people have browsed it

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;}
Copy after login

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!

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