Re: Object oriented page templates in PHP
| From: | Christer Edvartsen | Date: | Mon, 09 Apr 2012 16:13:38 +0000 |
| Subject: | Re: Object oriented page templates in PHP | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-59514@lists.php.net to get a copy of this message | ||
On 04/09/2012 05:10 PM, Tom Boutell wrote:
What if PHP supported a short tag for calling a method of $this? Then one could write: <?@escape($foo) ?> And 'escape' could be upgraded and modified as needed in an object oriented way without the need to type<?php $this-> many times.You might be able to achieve this using the prep extension written by Andrei Zmievski: https://github.com/andreiz/prep/ A relevant example can be found here: https://github.com/andreiz/prep/tree/master/examples/array_literal where he introduces an alternative syntax to array(). -- Christer Edvartsen http://cogo.wordpress.com/ http://twitter.com/#!/cogocogo