Prev | Current Page 44 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

com>
Please post comments or corrections to the Author Online forum at
http://www.manning-sandbox.com/forum.jspa?forumID=329

(annotation) <#1 convert special characters to their HTML entity representations.>
As, Zend_View is a PHP based template engine, we use PHP within the file to display data from the model
and controller. The template file, index.phtml in this case, is executed within a member function of Zend_View
and so $this is available within the template file which is the gateway to Zend_View??™s functionality. All
variables that have been assigned to the view from within the controller are available directly as properties of
$this, as can be seen by the use of $this->title within index.phtml. Also, a number of helper functions, are
provided for use by templates to make them easier to write.
The most commonly used helper function is escape(). This function is used to ensure that the output is
HTML-safe and helps to secure your site from Cross-Site Scripting (XSS) attacks. All variables that are not
expected to contain displayable HTML should be displayed via the escape() function. Zend_View??™s
architecture is designed so that creating new helper functions is encouraged. For maximum flexibility, the
convention is that view helper functions return their data and then the template file echoes it to the browser.


Pages:
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
Romantyczny weekend mimre.benton.pl out of home advertising cukiernia-stykowscy.pl wędkarstwo darłowo