DatsunBing
DatsunBing

Reputation: 9076

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 understand 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!

Upvotes: 0

Views: 71

Answers (2)

Brian Fisher
Brian Fisher

Reputation: 23989

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.

Upvotes: 0

akond
akond

Reputation: 16035

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);

Upvotes: 4

Related Questions