That's an invalid "tales" syntax. The correct expression following the ZPT
specs should be:

  tal:attributes="value firstname | nothing"

Where "nothing" is evaluated as a tales keyword which returns an empty
string.

I haven't used PHPTAL in a while and I can't remember if the "nothing"
keyword was supported in later versions. If not, an alternative is to use
the following:

  tal:attributes="value firstname | ''"

* Note two consecutive single quotes after the pipe, to indicate an empty
string.

regards,
/imv

On Fri, Aug 7, 2009 at 3:32 PM, 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
> set, this return an empty string.
>
> It's perfect for me, but I just want to be sure if this syntax is good and
> will not be deprecated in future.
>
> Thanks
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL@lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>
>
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to