Re: [PHPTAL] i18n:translate on an attribute ?

2008-04-26 Thread Iván -DrSlump- Montes
Does something like the following work?

tal:block tal:define=global submitMsg
  div i18n:translate=submit /
/tal:block
input type=submit name=submit tal:attributes=value submitMsg /


Iván


On Sat, Apr 26, 2008 at 5:58 PM, Guillaume Lecanu [EMAIL PROTECTED] wrote:

  Hi,

  Is it possible to change the text of an attributes ?

  For example I want to translate 'Send' : submit name=submit value=Send
 /

  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


Re: [PHPTAL] How managing checked=checked ?

2008-04-26 Thread Krzysztof Sikorski
  If ($agreement) {

  input type=checkbox name=agreement value=1 checked=checked /

  } else {

  input type=checkbox name=agreement value=1 /

  }

Exact conversion of your code would be:
input tal:condition=agreement type=checkbox name=agreement
value=1 checked=checked /
inout tal:condition=not:agreement type=checkbox name=agreement
value=1 /

You could also try code like this, but if condition evaluates to false
it will produce an empty argument instead of removing it completely -
which is not exactly what you asked for:
input type=checkbox name=agreement value=1
tal:attributes=checked php: agreement ? checked : null /
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal