如何在magento模板文件中获取controller名称,action名称和module name

/**
* get Controller name
*/
$this->getRequest()->getControllerName();
/**
* get Action name, i.e. the function inside the controller
*/
$this->getRequest()->getActionName();
/**
* get module name
*/
$this->getRequest()->getModuleName();
getRequest()方法还有很多很实用的东西,你在phtml文件中打印下试试
1
2
3
echo “
";
print_r($this->getRequest());
echo "
“;
 

猜你喜欢

转载自hnlixf.iteye.com/blog/1701556
今日推荐