`

如何在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 "
“;
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics