News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Adam Jensen's Blog:
Output Transformation in a Zend Framework Model Layer
April 06, 2009 @ 13:43:06

Adam Jensen has a new post to his blog today looking at a solution he's created to be able to access the raw input a user has entered.

I've run into a minor problem, and I'm not sure my solution is particularly ideal. See, the Zend_Form approach described above does a great job of implementing Chris Shiflett's Filter Input, Escape Output principle...user input is filtered for invalid HTML before it's ever saved to the model, and can then be escaped as appropriate in the view layer. But what happens if you need to be able to retrieve the user's original unfiltered input later?

While working with the raw data could be dangerous, he has created a custom model that, through the getters and setters and doing validation/sanitization and the presentation layer rather than behind the scenes. It's not ideal but he's willing to take suggestions...

0 comments voice your opinion now!
output sanitize filter transform getter setter raw user input


blog comments powered by Disqus

Similar Posts

Adam Jensen's Blog: Output Transformation in a Zend Framework Model Layer

NetTuts.com: Build Web Apps From Scratch With Laravel: Filters, Validations, and Files

PHPMaster.com: Building a Domain Model - An Introduction to Persistence Agnosticism

WeberDev.com: PHP 101 (part 13): The Trashman Cometh

Sameer Borate's Blog: Data filtering and validation using Inspekt


Community Events





Don't see your event here?
Let us know!


interview framework introduction library symfony laravel bugfix zendserver community voicesoftheelephpant install release api language deployment unittest opinion package podcast series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework