开发者

Differences between _redirect('*/*/') and _redirect('*/*')

开发者 https://www.devze.com 2023-02-02 05:58 出处:网络
I am a newbie to Magento and Zend frameworks. Here are two examples in Mage_Customer_AccountController:

I am a newbie to Magento and Zend frameworks. Here are two examples in Mage_Customer_AccountController:

line 127

public function loginPostAction(){
  if ($this->_getSession()->isLoggedIn()) {
         $this->_redirect('*/*/');
        开发者_如何转开发 return;
     }

and line 230

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

What difference will these two _redirect() result in?


These lines are equal, because Magento internally modifies url path to canonical view with "/" at the end.

The reason for writing once '*/*/' and other time '*/*' is just lack of style guidelines describing such cases for Magento developers. You can use any form you like.

0

精彩评论

暂无评论...
验证码 换一张
取 消