Home > Article > Backend Development > discuz template syntax
Discuz! The analysis of X template is mainly done by the ./source/class/class_template.php file. If you need to know more, please take a look at this file!
Template nesting syntax
The writing method of parsing the nested template content into PHP statements and merging them into this template
common/header corresponds to the common directory in a certain template series header.html template file
include nested template content when the program is running
Logical judgment if...else
Directly execute PHP code tag:
//Equivalent to
//Equivalent to
/ /Equivalent to
//Equivalent to
< ;!--{eval exit();}--> //Equivalent to
Output variables directly, which is equivalent to PHP's . The curly braces can be omitted but are not recommended. (The module program can only be called here after processing):
Ad embed point code:
//This is discuz embedded advertising. It is recommended that you customize the advertising space. The customized advertising space will automatically generate the calling code in the background. We only need Just paste and copy
Plug-in hook tag:
hook is the keyword, which means index_top is defined as a hook
Loop syntax (multiple loops possible)
Loop writing with array keys
HTML statement output by loop
No array Loop writing method of key
HTML statement output by loop
Discuz! After the language pack is loaded, the usage in the template file:
{lang forum_category_modedby}
The language package is in the ./source/language/ directory and is stored in the form of a PHP array
The above introduces the discuz template syntax, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.