Re: Object oriented page templates in PHP
On 2012-04-09, Tom Boutell <[email protected]> wrote:
> There's a reason I didn't try to kick this out as a fully formed RFC (:
>
> The choice of @ is a nonstarter, yes. I forgot that <? is a valid
> start code for PHP already so it is already valid PHP to write <?@.
Another tack to take is to use PHP's streams support. We did this in
ZF's Zend_View at one point to emulate short tags when they're disabled.
Basically, it allows you to pre-process the template file as it's being
included.
The downside is, of course, performance. However, you could very easily
add a caching layer to this as well to cache the modified code so that
subsequent calls do not have to do the pre-processing.
Basically, I think this is something that can be accomplished in
userland.
--
Matthew Weier O'Phinney
Project Lead | [email protected]
Zend Framework | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
Thread (11 messages)