网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > ZenCart
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 153.99.36.123
Old 2016-05-14, 05:11 PM
Ida Ida is offline
初级会员
 
Join Date: 2011-09-29
Posts: 3
Ida 现在声名狼藉
Default zencart v150 主要函数解析整理

1.get_template_part($page_directory, $template_part, $file_extension = '.php'):
$page_directory是文件目录,$template_part是匹配的条件,执行的结果是包含该目录下所有文件名匹配这个条件的文件;
比如index.php文件中,$directory_array = $template->get_template_part($code_page_directory, ‘/^header_php/’);
指的是包含includes/modules/pages/..所有以header_php开头的php文件。

2.get_template_dir($template_code, $current_template, $current_page, $template_dir, $debug=false):
首先,按优先级依次检测以下三个目录中有没有匹配$template_code 的这个文件,如有返回该目录。
(1) $current_template / $current_page /
(2) DIR_WS_TEMPLATES / template_default / $current_page /
(3) $current_template / $template_dir /
(4) 如以上三个目录都不存在,直接返回 DIR_WS_TEMPLATES / template_default / $template_dir /
然后,在返回的目录下查找$template_code文件。

比如index.php文件中,require($template->get_template_dir(’html_header.php’,DIR_WS_TEMPLATE, $current_page_base,’common’). ‘/html_header.php’); 假设当前url:http://localhost/zencart/index.php?main_page=product_info&cPath=48, 那么将会查找一下目录:
(1) includes/templates/product_info/.. html_header.php
(2) includes/templates/template_default/product_info/.. html_header.php
(3) includes/templates/common/.. html_header.php
(4) includes/templates/template_default/common/.. html_header.php (默认情况)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ZenCart 1.5.x 后台管理密码过期修改办法 Ronin ZenCart 0 2016-04-09 11:12 AM
ZenCart v1.5.5. remove or change greeting “Welcome Guest! Would you like to log yours Richwoods ZenCart 0 2016-04-09 10:40 AM
ZenCart auto facebook插件 配置使用 topvip ZenCart 0 2012-12-21 07:24 PM
How to Install an Zen Cart Template topvip ZenCart 0 2009-08-23 05:35 PM
Zencart Custom Footer car ZenCart 0 2009-07-15 12:11 AM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 06:00 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.