Re: [RFC] New operator for context-dependent escaping

From: Date: Sat, 23 Jul 2016 14:44:23 +0000
Subject: Re: [RFC] New operator for context-dependent escaping
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-94645@lists.php.net to get a copy of this message
On 22/07/2016 19:41, David Rodrigues wrote:
Fifth point: you can't use arguments on each escape to change the mean of what happen, so I need define each possibility (that could be a lot). For instance: imagine that I have a escape that does, on reality, a "clamp" that do a $value bet more than min, and less than max. It should receives two arguments (min and max) and optional one (inclusive). Currently I could do it like: <?= echo clamp($value, 5, 25, true); ?>. How you can do that on your case?
I think that's drifting a long way away from the idea of "simple escape syntax", and into "building a templating engine". I don't see any need for this list to concern itself with such a task, because Smarty, and Twig, and many others already exist for that job. "clamp()" is a data transform, but it's not an "escape" in any sense that I can think of. Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#94645) next »