PHP. after the MVC tag syntax is introduced, we can now look at the syntax of the template tag system. before looking at the specific tag, we should define what serves as our tag. to write a tag, we apply @... @ tag node. left tag
PHP. MVC label syntax
After the basic introduction, we can now look at the syntax of the template tag system.
Before looking at the specific tag, we should define what serves as our tag. to write a tag, we apply <@... @> tag node. the left tag (<@) and right tag (@>) are default labels. if necessary, these labels can be redefined in phpmvc-config.xml.
The template tag system now supports the following three types of labels: including commands, declarations, and expressions. let's take a look at these commands.
Include commands
The include command separates content into many modules, such as the header, footer, or content. the contained page can be HTML or other tag template pages. for example, the following include command can be used to contain a header:
<@ Include 'pageheader. SS' @>
An example of a template containing commands is as follows:
...
<@ Include 'pageheader. SS' @>
|
... ...
...
In this example, the content of the pageHeader. ssp header file will be inserted into the home page and sent to the user's browser. this header file contains an expression:
<@ = ViewConfig. getAppTitle @>
This expression will be compiled and output at runtime as follows:
Flash Jacks 'sleek Tab Site
Statement
The declaration promises to declare a page-level variable in the template, or even other include pages. a declaration looks like the following code:
<@ SalesAreaID = 'central District '@>
We can apply the declaration in the template file:
<@ SaleMonth = data. getValueBean ('sale _ month') @>
<@ SaleTitle = data. getValueBean ('sale _ title') @>
<@ DealHeading = data. getValueBean ('dest_heading ') @>
<@ SalesAreaID = 'central District '@>
<BR>... <BR>
...
In this example, we declare some page variables. the first three variables have been assigned a value in the ActionObject of the Action class we created: data. getValueBean ('sale _ month '). the first variable is assigned a string value: salesAreaID = 'central District '.