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

2009-08-07 Thread Kornel Lesiński
On 06-08-2009 at 22:53:22 Ionut Matei johnu...@gmail.com wrote: If a template contains php code, it gets into the compiled template and will be executed... I think a pre-filter can be created for stripping php code, but Is there a feature or setting in PHPTAL for preventing executing php

Re: [PHPTAL] disabling PHPTal parsing for blocks

2009-08-07 Thread Kornel Lesiński
On 06-08-2009 at 18:48:46 Richard Cernava cern...@gmail.com wrote: I'm at a loss to find a method to disable PHPTAL parsing for a block of XML/HTML. I am aware that there placing anything in a comment removes it exempts it from being parsed, but I have not found another method. What I'm

[PHPTAL] Need confirmation about the pipe syntax inside tal:attributes

2009-08-07 Thread Guillaume Lecanu
Hi everybody, I use this syntax : input name=firstname value= tal:attributes=value firstname| / Note the pipe character at the end of the expression. So, if the firstname value exists, this show it and if the value is not set, this return an empty string. It's perfect for me, but I just want

Re: [PHPTAL] Need confirmation about the pipe syntax inside tal:attributes

2009-08-07 Thread Levi Stanley
input name=firstname tal:attributes=value firstname | nothing/ Guillaume Lecanu wrote: Hi everybody, I use this syntax : input name=firstname value= tal:attributes=value firstname| / Note the pipe character at the end of the expression. So, if the firstname value exists, this show it and

Re: [PHPTAL] Need confirmation about the pipe syntax inside tal:attributes

2009-08-07 Thread Kornel Lesiński
On 07-08-2009 at 14:32:43 Guillaume Lecanu guilla...@lya.fr wrote: Hi everybody, I use this syntax : input name=firstname value= tal:attributes=value firstname| / Note the pipe character at the end of the expression. So, if the firstname value exists, this show it and if the value is not

Re: [PHPTAL] Need confirmation about the pipe syntax inside tal:attributes

2009-08-07 Thread Christoph Frick
On Fri, Aug 07, 2009 at 03:32:43PM +0200, Guillaume Lecanu wrote: input name=firstname value= tal:attributes=value firstname| / i usually use input name=firstname value= tal:attributes=value firstname|default / this uses the value from the value-attribute. the suggested nothing of course is

Re: [PHPTAL] Need confirmation about the pipe syntax inside tal:attributes

2009-08-07 Thread Guillaume Lecanu
I was well adviced to ask ! ;-) Thanks Iván, Kornel, Levi Christoph for your explanations ! Le vendredi 07 août 2009 à 15:47 +0200, Christoph Frick a écrit : On Fri, Aug 07, 2009 at 03:32:43PM +0200, Guillaume Lecanu wrote: input name=firstname value= tal:attributes=value firstname| /

[PHPTAL] What is the better way for Radio Button default value ?

2009-08-07 Thread Guillaume Lecanu
Hi again, I have in my form a field civility like that : labelCivility/label ul li input type=radio name=civility value=Miss id=civility-miss / label for=civility-missMiss/label /li li

Re: [PHPTAL] What is the better way for Radio Button default value ?

2009-08-07 Thread Kornel Lesiński
On 07-08-2009 at 15:08:03 Guillaume Lecanu guilla...@lya.fr wrote: Hi again, I have in my form a field civility like that : labelCivility/label ul li input type=radio name=civility value=Miss id=civility-miss / label

Re: [PHPTAL] What is the better way for Radio Button default value ?

2009-08-07 Thread Iván -DrSlump- Montes
I guess something like this should work. input type=radio tal:attributes=checked php:P.civility eq 'Miss' value=Miss ... / input type=radio tal:attributes=checked php:P.civility eq 'Ms' value=Ms ... / input type=radio tal:attributes=checked php:P.civility eq 'Mr' value=Mr ... / This is one of

Re: [PHPTAL] Re: disabling PHPTal parsing for blocks

2009-08-07 Thread Kornel Lesiński
On 07-08-2009 at 15:28:07 Richard Cernava cern...@gmail.com wrote: An example would be: span tal:content=string:I'm PHP/ div tal:interpret=false span tal:content=string:I'm javascript/ /div phptal's out put would be: spanI'm PHP/span div span tal:content=string:I'm javascript/ /div

Re: [PHPTAL] Re: disabling PHPTal parsing for blocks

2009-08-07 Thread Iván -DrSlump- Montes
As a work around perhaps you can place the Javascript template code in separate files and use them like this: script ?php include('my_javascript_tal_template.jstal'); ? /script regards, /imv On Fri, Aug 7, 2009 at 4:28 PM, Richard Cernava cern...@gmail.com wrote: Kornel Lesiński kor...@...

[PHPTAL] Re: disabling PHPTal parsing for blocks

2009-08-07 Thread Richard Cernava
As a work around perhaps you can place the Javascript template code in separate files and use them like this:script  ?php include('my_javascript_tal_template.jstal'); ?/script I hate to destroy the elegance of TAL :) I haven't looked into the metal macro library much, I may be able to work

[PHPTAL] PHP newline consumption

2009-08-07 Thread Richard Cernava
Hi, A feature of PHP's is to consume a newline when it is following it's closing tag (http://bugs.php.net/bug.php?id=28381). The reason I bring this up is because this issue affects PHPTAL's output. Take for example: tal:block tal:condition=trueI'm on a line/tal:block tal:block

[PHPTAL] Re: disabling PHPTal parsing for blocks

2009-08-07 Thread Richard Cernava
Kornel Lesiński kor...@... writes: Indeed, you'll have to pick another namespace (this works since 1.2.0): span tal:content=string:I'm PHP/ div xmlns:tal=http://example.com/ns/javascript-tal; span tal:content=string:I'm javascript/ /div Currently there's no option to generate