您的位置:首页 > 其它

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

2015-06-09 14:28 483 查看
/**
* 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 "
“;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: