you're right, but i didn't want to hardcode some current navigation point to every controller, because it corresponds 1:1 to the current controller class.
so i'm setting a c.current_nav depending on request.environ['pylons.routes_dict']['controller'] in a __before__ method in the BaseController class. thx for your advise! cheers, mike On Jan 19, 6:23 pm, Ben Bangert <[EMAIL PROTECTED]> wrote: > On Jan 19, 2008, at 8:40 AM, mcptron wrote: > > > how can i access the routes memory from within a mako template in > > pylons 0.9.6.1? > > > i would like to use this for marking the active navigation point > > within the template according to the current controller/action in the > > routes memory... > > I'd generally suggest setting up such references in a controller, to > avoid having too much logic nested in the templates. Ie, have the base > controller setup some standard 'c' vars for use in all your templates > and actions. > > The routes dict, which indicates all the route variables currently > matched, is in request.environ['pylons.routes_dict'] > > Cheers, > Ben > > smime.p7s > 3KDownload --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
