magento控制器机制

magento的请求周期(request cycle)

magento对某个URL的请求是如何被翻译成到某个特定模块的执行呢?我们来看一下下面的这个URL:

http://example.com/magento/(index.php)/customer/account/index/

以反斜杠为分隔符,URL分成以下这几部分:

http://example.com 域名

magento URL前缀

(index.php) 不一定会有这个部分。当你使用apache的rewrite功能时可以省略掉index.php

customer 模块名

account 前台控制器名

index action名,通常默认为index

要追踪一个对magento请求的执行过程并非易事,原因在于以下两点:
1、使用了router
2、使用了dispatch机制

 

详细参考:http://sjolzy.cn/magento-control-mechanism.html

posted @ 2014-03-07 16:25  lifeinearth  阅读(40)  评论(0)    收藏  举报