Magento helper autocomplete support

It great to make support for magento helpers.
It mean that
$this->helper('helpername') - is class Mage_HelperName_Helper_Data which is in the folder app\code\core\Mage\HelperName\Helper\Data.php
Be cool if phpstorm tell methods after type $this->helper('helpername')-> and press ctrl+space.
I understand that i can do this way
/** var $obj  Mage_HelperName_Helper_Data*/
$obj = $this->helper('helpername');
$obj->...
But it bad for magento update method.
--------------------[ru]--------------------------------------
Было бы классно сделать поддержку подсказок для magento helpers.
Я имею ввиду что для кода
$this->helper('helpername') который является классом Mage_HelperName_Helper_Data и лежит в папке app\code\core\Mage\HelperName\Helper\Data.php
сделать подсказки при вводе $this->helper('helpername')-> и нажатии ctrl+пробел
Я понимаю что я могу это сделать таким образом
/** var $obj  Mage_HelperName_Helper_Data*/
$obj = $this->helper('helpername');
$obj->....
Но это плохой для обновления маженто метод

2 comments
Comment actions Permalink

AFAIK this is copies Zend Framework helper system and thus is covered by WI-1063 and subtasks.

0
Comment actions Permalink

Its great!
ButI dont sure that it use Zend model

app\code\core\Mage\Core\Block\Abstract.php  | Mage_Core_Block_Abstract

 

public function helper($name)
{
    if ($this->getLayout()) {
        return $this->getLayout()->helper($name);
    }
    return Mage::helper($name);
}

 


$this->getLayout()->helper($name); call to app\code\core\Mage\Core\Model\Layout.php | Mage_Core_Model_Layout

 

    public function helper($name)
    {
        $helper = Mage::helper($name);
        if (!$helper) {
            return false;
        }
        return $helper->setLayout($this);
    }

 



Mage::helper call to

    public static function helper($name)
    {
        if (strpos($name, '/') === false) {
            $name .= '/data';
        }

        $registryKey = '_helper/' . $name;
        if (!self::registry($registryKey)) {
            $helperClass = self::getConfig()->getHelperClassName($name);
            self::register($registryKey, new $helperClass);
        }
        return self::registry($registryKey);
    }

0

Please sign in to leave a comment.