Re: [PHPTAL] Fwd: stripping or escaping php code in templates

2009-08-09 Thread Ionut Matei
Thank you all for your input. I want only to disable php blocks, to prevent echo-ing unescaped strings, like this: ?php echo $_SERVER['HTTP_REFERER; ? I'll go for a preFilter. Thanks! ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com

Re: [PHPTAL] tal:condition

2009-08-31 Thread Ionut Matei
This should do it: div class=errormsg tal:condition=errmsg eq 'unknonwn_user' Your username is unknown /div 2009/8/31 GRolf ger...@pictureparking.com the docs say about tal:condition that the block will only be shown if the expression evaluates to true... but I don't find the info if I

Re: [PHPTAL] tal:condition

2009-08-31 Thread Ionut Matei
2009/8/31 Ionut Matei johnu...@gmail.com This should do it: div class=errormsg tal:condition=errmsg eq 'unknonwn_user' Your username is unknown /div Sorry, I was wrong, I should have added php: http://phptal.org/manual/en/split/conditional.html -- it says: *These operators can

[PHPTAL] nl2br()-like for tal:content

2009-09-11 Thread Ionut Matei
Hello, How can I do in phptal something similar to ?php echo nl2br(htmlspecialchars($variable)); ? I think something like div tal:content=structure php: nl2br(htmlspecialchars(variable)) / will do it, but I'd not prefer to escape manually. ___ PHPTAL

Re: [PHPTAL] Yet another trap when converting to phptal 1.2.0

2009-10-15 Thread Ionut Matei
I don't think it's only on 1.2.0. To create an emty template, put an empty tal:block/. On Oct 16, 2009 3:12 AM, Wallace McGee wall...@petrosys.com.au wrote: Hi Guys, Just letting you know that now you are not allowed to have blank template files. I had used one on a page that generated some

[PHPTAL] optional attribute, based on another condition

2010-09-30 Thread Ionut Matei
Hello, I want the 'href' attribute to be skipped if $item['route'] is empty: a tal:content=php:tm._(item['title']) tal:attributes=href php:ro.gen(item['route'])/ the manual says attributes can be skipped with | nothing, but this is based on the attribute's value. Thanks!