开发者

Zend Framework View Helper: Where does this method come from?

I have a Zend view template with the following line of code:

$this->headTitle()->setSeparator(' - ')

My question is, where is the setSeparator() method declared?

I understan开发者_Go百科d that headTitle is a View Helper but when I look in the Zend_View_Helper_HeadTitle class I see no setSeparator method, nor any setter. Presumably the method (or an appropriate setter) is declared in the class' ancestors however I can't seem to find exactly where...

Thanks!


It is defined in Zend_View_Helper_Placeholder_Container_Abstract. The access to this method takes place in Zend_View_Helper_Placeholder_Container_Standalone class in its magic method __call :

$container = $this->getContainer();
if (method_exists($container, $method)) {
    $return = call_user_func_array(array($container, $method), $args);


It is defined using PHP magic method __set. The magic method is defined in the Zend_View_Helper_Placeholder_Container_Standalone class which is the base class for Zend_View_Helper_HeadLink.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜