x
 
Create New Page

Revision: Parse Order

Revision from: 21:04, 18 Aug 2009

Question:

In what order does EE parse a template?

Answer:

(>= v 1.5.2)

# Return Static Template
# Replace deprecated “not_logged_in” variables (now logged_in / logged_out)
# URI Segment variables {segment_x}
# {embed:foo} variable tags (sub-templates only)
# path.php Global Variables
# Parse Date Formatting “Constants”
# Parse {current_time} variables
# Retrieve Cached Template
## Advanced Conditionals
## Return completed template
# PHP (Input Stage)
# Conditionals (non-advanced)
## URI Segment conditionals
## Embedded variable conditionals
## Global Conditionals
# Dynamically Assigned Global Variables {assign_variable:foo=“bar”}
# Main Parsing - Process all {exp:...} tags in order encountered.
# PHP (Output Stage)
# Write new cache file
# Uncacheable Forms
## Comment Forms
## Stand-Alone Entry Forms
## Trackback Hashes
# Advanced Conditionals
# Process sub-templates {embed=template_group/template_name}
# Standard and User-Defined Global Variables (including path and stylesheet)
# Return completed template

Note: {redirect=} tags are “parsed” as part of main parsing, but the actual redirection doesn’t happen until the final step when the template is returned. So that means that all embedded templates and all conditionals get parsed before redirection actually happens.

Category:Templates

Category:EE1

Categories: