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.


Attachment: pgpZkdIBeJM0i.pgp
Description: PGP signature

PHPTAL mailing list

Reply via email to