模板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()是按顺序找的因此你只需在你的模板文件中存在该文件便可

lcloud零云:沪港IPLC,70元/月/200Mbps端口/共享IPv4/KVM;成都/德阳/雅安独立服务器低至400元/月起

lcloud怎么样?lcloud零云,UOVZ新开的子站,现在沪港iplc KVM VPS有端午节优惠,年付双倍流量,200Mbps带宽,性价比高。100Mbps带宽,500GB月流量,10个,512MB内存,优惠后月付70元,年付700元。另有国内独立服务器租用,泉州、佛山、成都、德阳、雅安独立服务器低至400元/月起!点击进入:lcloud官方网站地址lcloud零云优惠码:优惠码:bMVbR...

野草云提供适合入门建站香港云服务器 年付138元起 3M带宽 2GB内存

野草云服务商在前面的文章中也有多次提到,算是一个国内的小众服务商。促销活动也不是很多,比较专注个人云服务用户业务,之前和站长聊到不少网友选择他们家是用来做网站的。这不看到商家有提供香港云服务器的优惠促销,可选CN2、BGP线路、支持Linux与windows系统,支持故障自动迁移,使用NVMe优化的Ceph集群存储,比较适合建站用户选择使用,最低年付138元 。野草云(原野草主机),公司成立于20...

金山云:618年中促销,企业云服务器2核4G仅401.28元/年,827.64元/3年

金山云618年中促销活动正在进行中!金山云针对企业级新用户优惠力度比普通个人用户优惠力度要大,所以我们也是推荐企业新用户身份购买金山云企业级云服务器,尽量购买3年配置的,而不是限时秒杀活动中1年的机型。企业级用户购买金山云服务器推荐企业专区:云服务器N3 2核4G云服务器,1-5M带宽,827.64元/3年,性价比高,性能稳定!点击进入:金山云618年中促销活动目前,金山云基础型E1云服务器2核4...

zen-cart为你推荐
http404未找到打开网页提示HTTP 404未找到文件360退出北京时间utc+8 13:30-14:00换成北京时间是什么时候三五互联股票三五互联是什么股票中国保健养猪网135保健养猪,135天可以出栏吗?网络u盘网吧网络U盘是怎么弄的申请400电话电话是什么电话啊?怎么申请400电话400呢?具体收费价格是什么?艾泰科技闻泰科技是做什么的啊?有人能告诉我吗?zencart模板求zen-cart 模板结构zencart模板zencart里那些目录分别对应MVC设计模式的模型 视图 和控制器呢?图文模块微信公众号底部推荐阅读,图文模块是怎么实现的
域名服务器是什么 fdcservers linode themeforest 美国仿牌空间 空间打开慢 圣诞节促销 中国特价网 南昌服务器托管 智能骨干网 cpanel空间 大容量存储器 韩国名字大全 admit的用法 129邮箱 百度云1t 免费cdn 上海联通宽带测速 shuang12 沈阳主机托管 更多