Php. The label behavior scheduling of the template tag system of MVC

Source: Internet
Author: User
Template Tagactiondispatcher is an implementation of a standard Actiondispatcher class that supports access to basic template tags. The Tagactiondispatcher class supports the same Actionobjects collection and Viewresourcesconfig properties as the default Actiondispatcher. The Tagactiondispatcher class can be used with or without a template tag system, although it may cause small performance degradation due to its extra processing.

The template tag Library is PHP. The subsystem of the MVC framework structure, the template Tag Library Union Tagactiondispatcher work together to support some simple template tags.

The following chart shows the PHP. An overview of the MVC template tag system. The left side shows the program flow of the template label system. On the right is the Tagactiondispatcher program flow and how the label template interacts with these classes.



1. Initialization

When controller delivery control arrives at Tagactiondispatcher, some initialization triggers to set the Actionobjects and Viewresourcesconfig properties in order to use our template:
Re-obtain $form, $errors, and $data objects from the request, if any of these objects have been created before (for example, in the Action Class), the object will now be invisible in the resource template, or the object will be set to null.

Re-obtain the reference for the Viewresourcesconfig object, which contains the configuration parameters.

Sets the path to the template source file and the compiled template file in the Viewresourcesconfig parameter.

2, set the label page

The extension of the template source file (possibly ". SSP ") is used to compare the VIEWRESOURCESCONFIG->TAGFLAGSTR parameter to determine if the page needs to be processed, otherwise the page will be processed as a standard (no label) template file. We can configure the tag file name extension in the view-resources element, like this:

...
Tagflagstr = ". ssp
tagflagcnt = "-4"
...


TAGFLAGSTR indicates that the label template source file can be preprocessed, for example: MyPage. Ssp. This extension triggers tag processing. Property TAGFLAGCNT defines the number of characters at the end of the file name, including. "(xxxyyy. SSP). For example,-4 represents the last 4 characters of the source file name. The default value is. SSP and-4, so if we use a template filename like mypage. SSP, we do not need to set these parameters.

[1] [2] Next page



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.