Extend Zend_View_Stream to easily escape view variables

Zend_View_Stream is used pretty much when ever you use Zend_View, and I’ve blogged about how handy it is before.  But as it’s a class like any other, you can extend it to give added functionality.  One such use is to add automatic escaping to your view variables when you want.  So instead of doing:

<?php echo $this->escape($this->var); ?>
<?= $this->escape($this->var); ?>

You could simply do:

<?=~ $this->var; ?>

That’s a lot simpler, isn’t it?
Continue reading “Extend Zend_View_Stream to easily escape view variables”

Did you like this? Share it:



Usually I’m a total wallflower at conferences, gravitating to only the people I know. This time round I’m trying to change that and speak to people, ask speakers questions, and all that.

Right now, though, I’m enjoying dinner. 🙂

Did you like this? Share it:

PHPNW Conference 2010

Going to be travelling to the PHPNW Conference today (it’s tomorrow, but I don’t fancy catching the stupidly early train to get there on time), but going over the schedule is a pain… There are just too many good talks! How can I possibly go see them all?! The 11:15 time slot is easy, that’ll be Rob Allen’s talk on ZF 2 – we use it so much at work now that it’d be crazy to not find out what’s coming and how this may affect what we’re currently doing.  Same with the  Michelangelo van Dam talk on unit testing with ZF.  But the 12:15, 15:00 and 16:15 talks?  I have no idea what to choose!  Juozas Kaziukena’s Optimizing Zend Framework might be worth while, but then again, is it all about ZF1 and how much will be relevant for ZF2?  The HipHop talk by Scott McVicar would be interesting. I can’t see it being deployed at my work, should still be a good talk… I’m liking the sound of the Database version control without pain by Harrie Verveer as well!  And that still leaves me with two other time slots to decide on… Sheesh!

The agony of choice, eh? 😉

Did you like this? Share it: