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

pacificrack:超级秒杀,VPS低至$7.2/年,美国洛杉矶VPS,1Gbps带宽

pacificrack又追加了3款特价便宜vps搞促销,而且是直接7折优惠(一次性),低至年付7.2美元。这是本月第3波便宜vps了。熟悉pacificrack的知道机房是QN的洛杉矶,接入1Gbps带宽,KVM虚拟,纯SSD RAID10,自带一个IPv4。官方网站:https://pacificrack.com支持PayPal、支付宝等方式付款7折秒杀优惠码:R3UWUYF01T内存CPUSS...

CYUN(29元/月)美国、香港、台湾、日本、韩国CN2,续费原价

关于CYUN商家在之前有介绍过一次,CYUN是香港蓝米数据有限公司旗下的云计算服务品牌,和蓝米云、蓝米主机等同属该公司。商家主要是为个人开发者用户、中小型、大型企业用户提供一站式核心网络云端部署服务,促使用户云端部署化简为零,轻松快捷运用云计算。目前,CYUN主要运营美国、香港、台湾、日本、韩国CN2线路产品,包括云服务器、站群服务器和独立服务器等。这次看到CYUN夏季优惠活动发布了,依然是熟悉的...

BlueHost 周年庆典 - 美国/香港虚拟主机 美国SSD VPS低至月32元

我们对于BlueHost主机商还是比较熟悉的,早年我们还是全民使用虚拟主机的时候,大部分的外贸主机都会用到BlueHost无限虚拟主机方案,那时候他们商家只有一款虚拟主机方案。目前,商家国际款和国内款是有差异营销的,BlueHost国内有提供香港、美国、印度和欧洲机房。包括有提供虚拟主机、VPS和独立服务器。现在,BlueHost 商家周年活动,全场五折优惠。我们看看这次的活动有哪些值得选择的。 ...

zen-cart为你推荐
配置用于Windows搜狗360电脑自动安装360安全浏览器outlookexpressoutlook Express是什么啊?怎么用啊?my.qq.commy.qq.com,QQ用户上不去?my.qq.commy.qq.com我是CF会员吗美要求解锁iPhone苹果美版有锁和无锁的区别独立访客猎流的访问量都是真实的吗?想试试图文模块图文模块的标题栏填什么啊?财务单据我是做财务的,每个月都被各种票据搞得很头疼啊?求各位大神指教好方法!无忧验证码手机登录前程无忧怎么不显示登录验证码
apache虚拟主机 动态ip的vps 域名主机管理系统 yardvps bandwagonhost 外国服务器 缓存服务器 bash漏洞 北京双线机房 hostker cdn加速原理 电信主机 如何建立邮箱 阿里云免费邮箱 广州虚拟主机 测速电信 中美互联网论坛 防盗链 wannacry勒索病毒 西部主机 更多