You send a function just like any other object. By returning it as the
value in a dictionary.
python:
def hello_fn(name):
return 'Hello ' + name
return {
'hello': hello_fn,
}
jinja2:
{{ hello('bob') }}
- Michael
On Sun, Nov 16, 2014 at 12:37 PM, Rosciuc Bogdan
<[email protected]> wrote:
> Hello all,
>
> Pretty much what the title says. I've been trying to send a function I have
> created in a view to a Jinja2 template and I can't figure it out how. Could
> you please help me with this... an example may be useful as well.
>
> Thank you,
> Bogdan
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pylons-discuss.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.