The Zen Cart Execution Process
以:http://192.168.0.161/lightbox/index.php?main_page=account 为例
We know $main_page=account
index.php will do the following:
1. it loads 'includes/application_top.php'
This file will load in all of general definitions used site-wide, initialize some site-wide classes ($template, $db) and do other general stuff.
2. it loads all of the files starting with 'header_php' in 'includes/modules/pages/account'
'header_php.php'
3. now it loads from includes/templates/mytemplate/common/
'html_header.php'
The default html_header.php file will simply create all of the HTML up to the </head> tag
It loads 'includes/modules/meta_tags.php',
It loads 'includes/templates/mytemplate/css/style*.css'
It loads 'includes/templates/mytemplate/js/jscript_*.js'
'main_template_vars.php'
set $body_code to: includes/templates/mytemplate/templates/tpl_{$main_page}_default.php (tpl_account_default.php)
Here all of the program logic and variables will be mixed up with the actual displayed HTML code
'tpl_main_page.php'
this file lays out the basic page.
1. <body>
2. loads the 'includes/modules/header.php' file
3. if the left column is enabled, it loads 'includes/modules/column_left.php'
4. it loads the file set in $body_code (tpl_{$main_page}_default.php 也就是: tpl_account_default.php)
5. if the right column is enabled, it loads 'includes/modules/column_right.php'
6. loads 'includes/modules/footer.php'
7. </body>
Reference: The Zen Cart Execution Process