Sorry for not informing right away. TG2 here. Arndt, your solutions seems kind of scary, but i'll try that @.@ To use tg.url in jinja2 templates, i just need to add it to global vars, right?
On 2 mar, 14:28, Tim Black <[email protected]> wrote: > Christopher Arndt wrote: > > Italo Maia schrieb: > > >>> Is there a method to retrieve url paths to controllers or i'll have to > >>> hardcode them in my jinja templates? > > >>> In Django, i have the method reverse and the tag {% url %} for > >>> retrieving those. > > > Daniel Fetchinson schrieb: > > >> With tg1 you can use the tg.url( ) function in your templates. > > > How would that help? This function is only there to contruct URLs which > > are independent of where the *whole* application is mounted. In TG 1.x, > > the controllers do not "know", at which URL they are mounted. I believe > > the same is true for TG 2.x. > > > But you could pass the URL path where a controller is mounted to its > > constructor and use to construct URLs. You can then pass a function to > > construct URLs for your controller methods to the template. > > How about just modifying tg.url() to include the functionality you want? > > Tim Black -- You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en.

