RE: [PHP-DEV] PHP as a template language
| From: | John Crenshaw | Date: | Fri, 06 Apr 2012 19:05:04 +0000 |
| Subject: | RE: [PHP-DEV] PHP as a template language | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-59370@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Sébatien Durand [mailto:sunseb@live.com]
> Sent: Thursday, April 05, 2012 10:55 PM
> To: internals@lists.php.net
> Subject: [PHP-DEV] PHP as a template language
>
> IMHO, PHP is a great template language. This is what makes it so simple and powerful, compared
> to other web languages.
>
> So far, we have "<?php", "<?=" and various legacy syntaxes like
> "<?".
>
> A suggestion : deprecate these old tags and replace them with a more elegant and a shorter
> implementation.
>
> For example : "<%" and "<%=" or "{%" and "{{" ?
>
> What do you think, guys ?
Honestly this is the wrong question. PHP as a template language has much larger problems than this.
The difference between <?php echo and <?= is 7 characters and entirely cosmetic. The
difference relative to <?php echo htmlentities(..., ENT_QUOTES | ENT_HTML5, 'UTF-8');
?> however is 56 characters, security, and encoding bugs.
Proper handling of output escaping is standard in modern template languages.. The question
shouldn't be "should we add a cooler short tag?". The question should be "What
needs to be done to make PHP an industry leader in template languages again?".
My two cents,
John Crenshaw
Priacta, Inc.