On Sun, Mar 1, 2009 at 3:15 PM, ctalley <[email protected]> wrote: > > Is it possible to do this... > > <a href='/admin/default/design/myapp'>go to xyz page</a> > > ...which yields this URL... > > http://127.0.0.1:8000/admin/default/design/myapp > > ...using an HTML helper, like this... > > {{=A('go to xyz page',_href=URL(r=request,f='/admin/default/design/ > myapp'))}} > > ...which yields this URL...
Take a look at http://mdp.cti.depaul.edu/examples/default/api and http://mdp.cti.depaul.edu/examples/static/epydoc/index.html (look for function URL in gluon.html) Notice that request holds a=application and c=controller; you can override those one by one, so in your example r=request is completely unneeded since you are not using ANY part of what it provides to URL (not even the application); I think what you intended to write is something like: {{=A('go to xyz page',_href=URL(a='admin', c='default', f='design' args=['myapp']))}} If, for example, you wanted to do the same in the current app, you could write this in this way, and override the controller and function parts of the request: {{=A('go to xyz page',_href=URL(r=request, c='my_design_stuff', f='design' args=['myapp']))}} Does this help clarify? Regards, Yarko > > > http://127.0.0.1:8000/current_app/current_controller//admin/default/design/myapp > > Notice the first statement creates a link to the specified path. The > second statement, using the helper, automatically prepends / > current_app/current_controller/ to the URL. In other words, can the > helper support an absolute path vs. a relative path? > > Thanks. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

