2009年4月29日星期三

Re: [fw-mvc] How do I customize the escape() function for HTML rendering?

Thanks for your explanation. Scope and targeting is one of those things that
dogs me. I changed the var in the foreach to row, but you also have to use
it in each variable assignment. Your example has '$page_id =
$this->escape($text->page);'.

Here's what it looks like now:

foreach($this->text as $row) :
if ($this->escape($row->page) == $this->escape($this->id)) {
$page_id = $row->page;
$content1 = $row->content1;
$content2 = $row->content2;
}
endforeach;

You don't need to escape with each var assignment, so you can just go ahead
and <?php print $content1; ?>, and the html renders fine.

I hope this helps out others newbies like me!
--
View this message in context: http://www.nabble.com/How-do-I-customize-the-escape%28%29-function-for-HTML-rendering--tp23283430p23295981.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: