Thanks Yarko. Yes, I now see exactly that the source of my confusion was not understanding r=request and what it does in building the URL. It's basically shorthand for the present application and controller whereas I was trying to link to something outside the present application and controller. The resulting URL combined the two and therefore made no sense.
On Mar 1, 9:51 pm, Yarko Tymciurak <[email protected]> wrote: > 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 athttp://mdp.cti.depaul.edu/examples/default/api > andhttp://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/d... > > > 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.- Hide quoted text - > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

