Re: Class Static variables in double quoted string or heredoc

From: Date: Fri, 25 Apr 2008 19:08:37 +0000
Subject: Re: Class Static variables in double quoted string or heredoc
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.general 
Request: Send a blank email to php-general+get-273600@lists.php.net to get a copy of this message
On Fri, Apr 25, 2008 at 2:51 PM, Nathan Nobbe <quickshiftin@gmail.com> wrote: > class OutputEscaper { I dunno man. I have an escape() method on different classes such as View (which can be told to use htmlspecialchars/entities), DB, etc. This way you know you're doing $view->escape() or $db->escape() instead of some generic thing. I think it helps me realize the context a bit more than a stand-alone escaper that doesn't know the details of what database I'm using or my target x/html output. You could then argue that if you're trying to output user values in HTML you should be working with something like htmlpurifier anyways. But there are only so many hours in the day... But back to the original point, you're cheating because you have instances there, not static calls! :P

« previous php.general (#273600) next »