-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Just to add:
any of this API changes would be a BC break. If you can access the URL view helper as $this->url() or $this->urlHelper(), one could actually have one of those method-names already used in his controller. Or am I too strict with BC here? Matthew? ................................... : ___ _ ___ ___ ___ _ ___ : : | \ /_\ / __| _ \ _ (_) \ : : | |) / _ \\__ \ _/ / | |) | : : |___/_/:\_\___/_| |_|_\_|___/ : :........:........................: : Web : http://www.dasprids.de : : E-mail : m...@dasprids.de : : Jabber : jab...@dasprids.de : : ICQ : 105677955 : :........:........................: Ben Scholzen 'DASPRiD' schrieb: > Or, as actions are suffixed with Action, helpers could thus be suffixed > with Helper. So you could access the URL-Helper like this: > > $this->urlHelper(...); > > Just random thoughts. > ................................... > : ___ _ ___ ___ ___ _ ___ : > : | \ /_\ / __| _ \ _ (_) \ : > : | |) / _ \\__ \ _/ / | |) | : > : |___/_/:\_\___/_| |_|_\_|___/ : > :........:........................: > : Web : http://www.dasprids.de : > : E-mail : m...@dasprids.de : > : Jabber : jab...@dasprids.de : > : ICQ : 105677955 : > :........:........................: > > > Marko Korhonen schrieb: >> Thanks for the great feedback! > >> I already converted many of my methods to actions helpers or moved them to >> controller plugins. > >> When I was exploring documentation and code I had a following idea: > >> In Zend_Controller_Action there is __call method: >> public function __call($methodName, $args) >> { >> require_once 'Zend/Controller/Action/Exception.php'; >> if ('Action' == substr($methodName, -6)) { >> $action = substr($methodName, 0, strlen($methodName) - 6); >> throw new Zend_Controller_Action_Exception(sprintf('Action "%s" >> does not exist and was not trapped in __call()', $action), 404); >> } > >> throw new Zend_Controller_Action_Exception(sprintf('Method "%s" does >> not exist and was not trapped in __call()', $methodName), 500); >> } > > >> Could it have updated so, it checks action helpers also? Something like >> this: > >> public function __call($methodName, $args) >> { >> require_once 'Zend/Controller/Action/Exception.php'; >> if ('Action' == substr($methodName, -6)) { >> $action = substr($methodName, 0, strlen($methodName) - 6); >> throw new Zend_Controller_Action_Exception(sprintf('Action "%s" >> does not exist and was not trapped in __call()', $action), 404); >> } >> else { >> try { >> return >> call_user_func_array(array($this->_helper, $methodName), $args); >> } catch (Zend_Controller_Action_Exception $e) { >> } >> } > >> throw new Zend_Controller_Action_Exception(sprintf('Method "%s" does >> not exist and was not trapped in __call()', $methodName), 500); >> } > > >> When I use action helpers in the code, lines look like this: >> $this->_helper->somehelper($arg1); // goes to helper's direct() method >> with this __call update this could be shorter: >> $this->somehelper($arg1); > >> I already tried it and it worked. But are there any other things to be >> considered? > > >> br, Marko -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmcJZsACgkQ0HfT5Ws789CslgCfUxSp0buXt5AXvJ4ahHbW3wsS 3jEAn2Ji+NaKQjVaXgB9rKkg9j+09W13 =lWl+ -----END PGP SIGNATURE-----