Hi,
On 15 Jul 2009, at 13:21, Ondrej Ivanič wrote:
On Wed, Jul 15, 2009 at 5:12 PM, Carlton
Just an idea/suggestion here, could we have an optional second param to escape() which if provided would override the default (just for that usage)?


You need at least two parameters additional for escaping because you
have to sometimes specify context. For example, value of style
attribute: escape function needs to know context (= html attribute)
and value (= css expression)

Perhaps I'm not fully on board with what you're after but, I imagined all of that to be taken care of by the callback (closure?) passed in as the second parameter.

Then, say it's html by default, normally I just do this:

$this->title

But if, for the sake of trying something out I've embedded some non- html, I do this:

$this->escape($this->script, function($value) { ... });

IMO, this is no worse than the current situation and (if I understand you right) it gives you the flexibility you need?

Regards,
Carlton

Reply via email to