here is an example of a Zend View filter:
http://dev.bigace.org/api/3.0/Bigace_Zend/View_Filter/Bigace_Zend_View_Filter_ObfuscateMailto.html
It filters the found mailto links and obfuscates them.
The Zend View filter does something in the already processed phtml file (= html code) before sending it to the client.
This is a Zend_Filter that can be used to display Zend View.
Here is another code example:
http://www.phpgangsta.de/zend_view-output-filter-whitespaces-aus-html-entfernen
Filter class (filters spaces from html = less code to send):
<?php class App_View_Filter_Minify implements Zend_Filter_Interface { public function filter($string) { return preg_replace( array('/>\s+/', '/\s+</', '/[\r\n]+/'), array('>', '<', ' '), $string ); } }
Then add a filter to the view:
protected function _initViewFilter() { $view = $this->getResource('view'); $view->addFilterPath('App/View/Filter', 'App_View_Filter_') ->addFilter('Minify'); }
Lucian depold
source share