[PHPTAL] Chains of strings in PHPTAL

2008-12-22 Thread Szymek PrzybyƂ

I want to add names for inputs like this:

input type=text name=team[x]/

Where x is number of team. Something like this:

input type=text tal:attributes=name php:'team['.team['id'].']' /

Doesn't works, but this:

input type=text tal:attributes=name php:'team['.user['id']/
(without ending ] )
Works. How can I add this names with ] ending?


cheers!
szymek

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Chains of strings in PHPTAL

2008-12-22 Thread Christoph Frick
On Mon, Dec 22, 2008 at 06:14:23PM +0100, Szymek Przyby? wrote:
 I want to add names for inputs like this:

 input type=text name=team[x]/

 Where x is number of team. Something like this:

 input type=text tal:attributes=name php:'team['.team['id'].']' /

 Doesn't works, but this:

 input type=text tal:attributes=name php:'team['.user['id']/
 (without ending ] )
 Works. How can I add this names with ] ending?

input type=text name=team[${team/id}]/

- or -

input type=text tal:attributes=name string:team[${team/id}]/

should do. 

avoid the use of php: - it usually tends to get ugly. you could even
create the names in your app or write an accessor for it. would even
make sense, once your app will read them again.

-- 
cu


pgpZkdIBeJM0i.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal