_redirect('* / * /')和_redirect('* / *')之间的差异

时间:2011-01-05 05:54:36

标签: zend-framework magento

我是Magento和Zend框架的新手。以下是Mage_Customer_AccountController中的两个示例:

第127行

public function loginPostAction(){
  if ($this->_getSession()->isLoggedIn()) {
         $this->_redirect('*/*/');
         return;
     }

和第230行

public function createAction()
    {
        if ($this->_getSession()->isLoggedIn()) {
            $this->_redirect('*/*');
            return;
        }

这两个_redirect()会产生什么不同?

1 个答案:

答案 0 :(得分:3)

这些行是相同的,因为Magento在内部修改了带有“/”的规范视图的url路径。

写一次'* / * /'和其他时间'* / *'的原因只是缺少描述Magento开发人员此类案例的风格指南。你可以使用任何你喜欢的形式。

相关问题