Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (1)

View Page History
This will not help in all situations -- return values from view variable method calls or properties, or values from arrays would not be escaped in this fashion. An enhanced stream wrapper could solve this issue.

h2. Helper Interface and Abstract

Currently, it's not entirely clear that you have to implement setView() in your helpers to have view awareness. Additionally, the naming conventions often get in the way, and don't follow best practices ala design patterns. The recommendation is to have a helper interface like this:

{code:php}
interface Zend_View_Helper_Interface
{
public function setView(Zend_View_Interface $view);
public function getView();
public function direct(); // method called when helper invoked
}
{code:php}

Additionally, an abstract class implementing this would be created:

{code:php}
abstract class Zend_View_Helper_Abstract implements Zend_View_Helper_Interface
{
public $view;

public function setView(Zend_View_Interface $view)
{
$this->view = $view;
return $this;
}

public function getView()
{
return $this->view;
}
}
{code}

Helpers would then extend the abstract class and implement the direct() method as necessary.

h2. Revisit Zend_View_Interface