12-06-2011

Zend Framework access view inside custom view helper

To access the view instance from your homemade view helper you just need to create a setView method and view property. This will be automatically called upon instantiation, setting the view variable to point at the view instance.

Example:

class Zend_View_Helper_Navigate {
 
	public $view;
 
    	function setView($view){
 
        	$this->view = $view;
    	}
 
 
	function navigate(){
		//more helper code
	}
}
Keywords: view helper

Comments:

Your comment:

»

 

[x]