On Wed, Jan 7, 2009 at 4:09 PM, mk <[email protected]> wrote:
>
> Jorge Vargas wrote:
>
>>> So my question is, what is h variable mainly for? Should I use it in
>>> (mainly or only in) templates or are there uses for it in controller
>>> code? If so, how to access it there?
>
>> h stands for helpers, and it's a couple of functions provided by
>> pylons, webhelpers and your own /lib/helpers.py file.
>> as for using them (helpers, not h) on the controller what I do is
>> simply import it, either from webhelpers or your lib/helpers.py
>
> And normally you would use helpers mostly in templates, right?
>
Must of the time yes, but there is no restriction I got several
"controller helpers" for example one to retrieve the list of possible
values for a dropdown box.

Since they are simply python functions that return strings (that's why
I love it so much) possibilities are endless

>> As for url_for I think you are breaking MVC a little here, why will
>> you want the URL for another part of your site in the controller?
>
> Just testing what it's good for. :-)
>
> Regards,
> mk
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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