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

RAKsmart含站群服务器/10G带宽不限流量首月半价

RAKsmart 商家估摸着前段时间服务器囤货较多,这两个月的促销活动好像有点针对独立服务器。前面才整理到七月份的服务器活动在有一些配置上比上个月折扣力度是大很多,而且今天看到再来部分的服务器首月半价,一般这样的促销有可能是商家库存充裕。比如近期有一些服务商挖矿服务器销售不好,也都会采用这些策略,就好比电脑硬件最近也有下降。不管如何,我们选择服务器或者VPS主机要本着符合自己需求,如果业务不需要,...

CloudCone(1.99美元),可以额外选择Voxility高防IP

CloudCone 商家也是比较有特点的,和我们熟悉的DO、Vultr、Linode商家均是可以随时删除机器开通的小时计费模式。这个对于有需要短租服务器的来说是比较有性价比的。但是,他们还有一个缺点就是机房比较少,不同于上面几个小时计费服务商可以有多机房可选,如果有这个多机房方案的话,应该更有特点。这次我们可以看到CloudCone闪购活动提供洛杉矶三个促销方案,低至月付1.99美元。商家也可以随...

FlashFXP FTP工具无法连接主机常见原因及解决办法

目前,我们都在用哪个FTP软件?喜欢用的是WinSCP,是一款免费的FTP/SFTP软件。今天在帮助一个网友远程解决问题的时候看到他用的是FlashFXP FTP工具,这个工具以前我也用过,不过正版是需要付费的,但是网上有很多的绿色版本和破解版本。考虑到安全的问题,个人不建议选择破解版。但是这款软件还是比较好用的。今天主要是遇到他的虚拟主机无法通过FTP连接主机,这里我就帮忙看看到底是什么问题。一...

zen-cart为你推荐
现有新的ios更新可用请从ios14be苹果手机更新不了最新14系统是怎么回事?phpwindphpwind怎么用?免费么?请详细说明360退出北京时间为什么我电脑上的时间跟北京时间不同步!!!中国企业在线有什么B2B网站可以做国外的?多给些。。回答的好追加ym.163.com网易163企业邮箱的foxmail怎样设置?波音737起飞爆胎为什么客机每次起飞都要先跑一段距离360公司迁至天津天津360公司?360开户哪家好?360开户费多少?360推广怎么样?360效果怎么样?360和百度相比哪个更合适?flashfxp下载求最新无需注册的FlashFXP下载地址360防火墙在哪里电脑或电脑360有联网防火墙吗,在哪里设置flashfxp注册码谁知道 FlashFXP.rar的注册码?
备案域名查询 linuxvps cn域名个人注册 zpanel windows主机 圣迭戈 优key 20g硬盘 tightvnc 远程登陆工具 空间服务商 777te 有益网络 福建铁通 免费cdn 厦门电信 web服务器搭建 架设邮件服务器 服务器维护 英雄联盟台服官网 更多