On May 9, 2006, at 2:51 AM, Alex Greif wrote:

> In the section "Passing Variables to Templates" of the "Getting
> Started" document It would be helpful to mention the alternative way,
> which IMO is more intuitive:
>
> action code:
>
> def serverinfo(self):
>     m.subexec('/serverinfo.myt', value=2)
>
> serverinfo.myt code:
> <%args>
>     value
> </%args>
> <p>The value of <tt>c.value</tt> is:
> <% value %>

True, that is a bit more explicit. The nice thing about using 'c' 
however is that it makes the variable more portable. You can use it 
consistently with different template languages as is. As Pylons trunk 
makes it even easier to change the default template language and use 
additional ones, this concept becomes a bit more primary.

I think noting that method of passing variables is quite handy for 
those coming from plain Myghty however, who will wonder why their 
templates aren't recieving <%args> variables.

Cheers,
Ben


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to