Re: Object oriented page templates in PHP
| From: | Paul Dragoonis | Date: | Mon, 09 Apr 2012 16:03:48 +0000 |
| Subject: | Re: Object oriented page templates in PHP | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-59511@lists.php.net to get a copy of this message | ||
-1.
PHP doesn't need more magic.
On Mon, Apr 9, 2012 at 4:53 PM, Nikita Popov <nikita.ppv@googlemail.com>wrote:
> On Mon, Apr 9, 2012 at 5:10 PM, Tom Boutell <tom@punkave.com> wrote:
> > What if PHP supported a short tag for calling a method of $this?
> >
> > Then one could write:
> >
> > <?@escape($foo) ?>
>
> A big -1 on this.
>
> If you want to roll your own template syntax, just do so. It's not
> that hard to run a quick str_replace('<?@', '<?php echo $this->',
> $code) over the template.
>
> Especially consider that @ is already used for error suppression, so
> code that previously just wanted to suppress some errors will suddenly
> try to call class methods (which obviously will lead to fatal errors).
>
> Nikita
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>