网站大量收购独家精品文档,联系QQ:2885784924

cs-cart-控制器.doc

  1. 1、本文档共7页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
cs-cart-控制器

Controllers – 控制器 发表于 2012 年 4 月 16 日 Controllers 控制器 Basic schema of the software functioning consists in calling one of the two main executable PHP files (admin.php or index.php) and further consecutive execution of PHP files implementing the program functionality. 软件运行的基本模式是调用两个主程序PHP文件(admin.php或index.php)之一,然后通过进一步连续执行其它的PHP文件来实现程序功能。 1. index.php 或 admin.php - 2.prepare.php - 3. init.php - 4. [controller_name].php In CS-Cart terms a file connected under number four is named a controller. Data handling in the program is performed in this file – extracting the necessary data from the database, data handling, calculations, transformations, etc. and preparation of the data for further display. 在CS-Cart规则中,上述第4项中被连接的文件被叫做控制器。程序通过这个文件实施数据处理—包括从数据库中提取必要的数据、数据处理、计算、转换等,并为进一步显示准备数据。 A path to the controller and its name are defined by the program automatically based on the value of the “dispatch” parameter, which was passed to the main executable file. The “dispatch” parameter has the following format “[controller_name].[mode_name]“, where “[controller_name]” – is a name of the controller, and “[mode_name]” – mode in which the called controller will work. The name of the called file will be “[controller_name].php”. 通过传递给主程序文件”dispatch”参数的值,程序可以自动定义到控制器的路径和它的名称。”dispatch”参数格式为 “[controller_name].[mode_name]“,其中 “[controller_name]“是控制器名称, “[mode_name]” 为所调用控制器的运行模式。调用的文件名将是”[controller_name].php”。 All controllers for the admin panel (executable file – admin.php) are located in the “/controllers/admin” directory, for the customer area (index.php) – in the “/controllers/customer” directory. If the called controller is not in these directories, then the system tries to launch it from “controllers/common”. This is done for the situations when the same controller is to serve the customer and administrator areas and its function is the same for both areas. 所以针对管理面板(执行文件 – admin.php)的控制器都位于”/controllers/admin”目录,针对客户区域 (index.php)的控制器都位于 “/controllers/customer”目录。如果调用的控制器不在这两个

文档评论(0)

cj80011 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档