tmpl_deny_php this argument to false try the config file
' tmpl_deny_php ' => false,///The default template engine disables PHP native code
PHP code can be mixed with tags in template files, you can write arbitrary PHP statement code in the template file, including the following two ways:
The first is the use of PHP Tags:
For example:
<php>echo ' hello,world! '; </PHP>&NBSP
We recommend that you use PHP tags as much as possible when using PHP code, because native PHP syntax may be configured to disable and cause parsing errors. &NBSP
The second way is to use the original PHP code directly:
<?php echo ' hello,world! ';? >
Note: tags (including regular tags and XML tags) can no longer be used in PHP tags or php code, so the following methods are not valid:
<php><eq name= ' name ' value= ' Value ' >value</eq></php>
The EQ tag is used inside the PHP tag, so it is invalid
<php>if ({$user}!= ' thinkphp ') echo ' thinkphp '; </php>
PHP tag uses the {$user} normal label output variable and is therefore invalid. &NBSP
<php>if ($user. Name!= ' thinkphp ') echo ' thinkphp '; </php>
PHP tag uses $ User.Name point syntax variable output, therefore invalid. &NBSP
In short, the PHP tag does not use code that is not supported by PHP itself. &NBSP
If the tmpl_deny_php parameter is set to True, native PHP code cannot be used in the template, but PHP tag output is still supported.