模板Zen Cart主要文件详解(Zen Cart main file detailed explanation)

zen-cart  时间:2021-04-15  阅读:()

Zen Cart主要文件详解Zen Cart main file detailed explanationAs the application_top.php in ZenCart system is theinitialization tasks, loading the configuration file forexample include ("includes/configure.php") ; , if not detectedin the file system will try to call the device file.

Then, it will take the initiative to traverse the configurationfile under include/extra_configures and include it.

After loading the next configuration file system is a veryimportant document, which led to the ZenCart and oscommercefeel very different causes, first invokes a require file("includes/initsystem.php") ;

In initsystem.php the first loadinginclude/auto_loaders/conf ig. core.php, conf ig. core.php is atwo round array$autoLoadConf ig, with an array of storage fileinformation for front file, then the system will then loadedthe include/auto_loaders directory of all the file name$loaderPrefix (default config) matching file.

The following program execution after the loading is activelyexecuting program require ("includes/autoload_func.php") ;here it will traverse the $autoLoadConfig array, which lasteffect will include all the necessary use may define functionclass, and variable initialization, the config.core.phpoutside of the obvious example

$autoLoadConf ig[0] [] =array ('autoType' ='c las s' , ' loadFi le'=' class.base.php ' ) ;

Outside the autoload_func.php executed after the effect isrequire (DIR_WS_CLASSES' class.base.php ' ) , the task is toinitialize the local big finish after including theinit_includes directory file, such as:

$autoLoadConf ig[110] [] = array ('autoType' = ' init_script' ,' loadFi le' = ' init_templates.php' ) ;

After executing the autoload_func.php file, it has loaded theinit_templates.php file under the init_includes directory.The above to explain how ZenCart is in accordance with the touchversion of the content displayed.

In the twenty-ninth line of index.php, there is a sentence$directory_array = $template->get_template_part

($code_page_directory, ` /^header_php/ ' ) ;

Since all initialization tasks havebeen completed, we can thenfind their definitions in the following files, such as$autoLoadConf ig[100] [] = array ('autoType' =

' classInstant iate' , 'c las sName' = 'template_func' ,

'obj ectName' = ' template' ) ;

Here is the definition of the $template = new (template_func,$code_page_directory) ; and the definition of variables isdefined here must be defined on the template_func class inclass/template_func.php more familiar with theinit_includes/init_sanitize.php file, in this kind of

important definition of the get_template_dir two approach(get_template_part) and () ;

These two approaches play a deterministic role in the use ofzencart templates.

Get_template_dir function get_template_dir ($template_code,$current_template, $current_page, $template_dir,

$debug=false) , which defines 5 parameters, the first parameteris the common name, it is this file used to form two parameterdiscriminationafter directoryhas nomatching$template_code,the transcript of the acquiescence of system functionfile_exists so many beginners can have doubts

Function, get_template_dir ($template_code,

$current_template, $current_page, $template_dir,

$debug=fal se) {

//echo 'template_default/' . $template_dir. '=' .

$template_code;

If ($this->file_exists ($current_template, $current_page,$template_code)) {

Return $current_template. $current_page. \ / \ ";

}elseif ($thi s->file_exists (DIR_WS_TEMPLATES) ,template_default/, $current_page, ereg_replace (` / ' , ' , ' , '$template_code ' ) , $debug)) {

Return DIR_WS_TEMPLATES. ' template_default/' . $current_page;

} elseif ($this->file_exists ($current_template,

$template_dir, $template_code, ereg_replace (` /' , ' , ' , ' , ' , '$debug ' )) {

Return $current_template. $template_dir;

} else {

Return DIR_WS_TEMPLATES. 'template_default/' . $template_dir;//return $current_template. $template_dir;

}

}

*as

Includes/templates/zccn/index

Includes/templates/template_default/index

Includes/templates/zccn/common

Includes/templates/template_defaul t/common

* /

(get_template_part) method has two functions, the firstparameter is the file directory, the second parameter is thematching requirements, implementation is the consequence ofincluding the directory of all the required document file namematching

For example, $directory_array = $template->get_template_part($code_page_directory, '/^header_php/' ) ;

This sentence is to enforce the consequences of all

$code_page_directory directory under the file name toheader_php off the file

The URL (http://localhost/zencart/index.php,main_page=product_info&cPath=49_27&products_id=83) at thistime?

When you should check the definition of init_sanitize.php in$code_page_directory, the value of $code_page_directory atthis time should be includes/modules/product_info/

Therefore, it should be included in the directory to mop up allheader_php files, in here it seems only a header_php.phpdirectory_array美元=模板-> get_template_part美元美元code_page_directory / ^ header_php /” 这个包括文件实际上是初始化前台不同页面显示所需求用到的变量函数重要是初始化数据库的东西 由于每个页面需求的数据材料都有能够不同 因此index.php main_page=指数当main_page的值不同是在包括/模块/目录下都会有个相应的目录这里是指数目录

只需晓得了这两个办法的用法你就会晓得模板文件都是怎样显示出来的了

再来说明一要求$模板->get_template_dir 'html_header。 phpdir_ws_template current_page_base美元普通的。 “/html_header PHP

假定目前网址 HTTP / /本地/执行/的index.php mai n_page =指数与cpath = 48dir_ws_template定义是在包括/ ini t_templates。 PHP中定义定义

'dir_ws_template '  dir_ws_templates。 template_dir美元。

“/”   由于我如今用的是默许的zccn模板

因此如今的dir_ws_template = includes/templates/ zccn /current_page_base在这里已然就是美元指数

面已然说明了模板-> get_template_dir()的办法了美元

程序会顺次在

包括/模板/ zccn /指数

包括/模板/ templ ate_de fau l t /指数

包括/模板/ zccn /普通

包括/模板/ templ ate_de fau l t /普通

这四个目录下找html_header。 PHP在这里最后在

template_default \共同目录下找到html_header.php

到这里就能够本身写摸板文件了美元 由于模板->get_template_dir()是按顺序找的因此你只需在你的模板文件中存在该文件便可

VoLLcloud(月付低至2.8刀)香港vps大带宽,三网直连

VoLLcloud LLC是一家成立于2020年12月互联网服务提供商企业,于2021年1月份投入云计算应用服务,为广大用户群体提供云服务平台,已经多个数据中心部署云计算中心,其中包括亚洲、美国、欧洲等地区,拥有自己的研发和技术服务团队。现七夕将至,VoLLcloud LLC 推出亚洲地区(香港)所有产品7折优惠,该产品为CMI线路,去程三网163,回程三网CMI线路,默认赠送 2G DDoS/C...

A400互联(49元/月)洛杉矶CN2 GIA+BGP、1Gbps带宽,全场独服永久5折优惠

a400互联是一家成立于2020年商家,主营美国机房的产品,包括BGP线路、CN2 GIA线路的云服务器、独立服务器、高防服务器,接入线路优质,延迟低,稳定性高,额外也还有香港云服务器业务。当前,全场服务器5折,香港VPS7折,洛杉矶VPS5折,限时促销!A400互联官网:https://a400.net/优惠活动全场独服永久5折优惠(续费同价):0722香港VPS七折优惠:0711洛杉矶VPS五...

Linode十八周年及未来展望

这两天Linode发布了十八周年的博文和邮件,回顾了过去取得的成绩和对未来的展望。作为一家运营18年的VPS主机商,Linode无疑是有一些可取之处的,商家提供基于KVM架构的VPS主机,支持随时删除(按小时计费),可选包括美国、英国、新加坡、日本、印度、加拿大、德国等全球十多个数据中心,所有机器提供高出入网带宽,最低仅$5/月($0.0075/小时)。This month marks Linod...

zen-cart为你推荐
回复邮箱1013556608@qq.com支持ipadphpadmin下载免费MP3下载phpadmin下载求张艺兴《莲》mp3下载支付宝蜻蜓发布支付宝蜻蜓f4,可以让没有支付宝的人刷脸付款?360和搜狗360搜索和搜狗搜索谁好谁流量大?为什么我在网上搜索到的数据有一定矛盾?做广告推广哪个好呢?全国企业信息查询全国企业信用信息公示系统查询入口 及操作说明哪里有?重庆400年老树穿楼生长重庆适宜驴生长重庆网站制作请问重庆那一家网站制作公司资信度比较好?技术实力雄厚呢?360防火墙在哪里设置360防火墙怎么开启啊 我要9.3的
域名查询工具 国际域名抢注 金万维动态域名 香港ufo 轻博客 seovip 商家促销 40g硬盘 数字域名 服务器维护方案 南通服务器 天翼云盘 能外链的相册 银盘服务 美国独立日 四川电信商城 百度云空间 photobucket 杭州电信宽带优惠 酸酸乳 更多