On 9 May 2012 06:27, Theron Luhn <[email protected]> wrote:
> I can pass variables into my template by returning them in a dictionary from
> the view controller. However, if I try to access a variable from the
> template that I didn't pass, I'll get an error.  Is it possible to have a
> default value so I don't get an error?

Yes!

You can use the "|" operator:

   <div>
      Hello, ${name | "world"}.
   </div>

(Note that you can even use it several times, to provide multiple
"fallback" expressions.

\malthe

-- 
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?hl=en.

Reply via email to