LOAD without div (internal redirect)

49 views
Skip to first unread message

Facundo

unread,
Jul 5, 2016, 9:17:52 AM7/5/16
to web2py-users
I want to make an internal redirect and I read that I can use LOAD,  but the problem is that it creates a div.

The only option I see is passing the LOAD thru a regex which deletes the div.

But, is there a way to make a internal redirect? Or, can I disable de div in the response of the LOAD?

Thanks!

Marlysson Silva

unread,
Jul 5, 2016, 9:47:33 AM7/5/16
to web2py-users
Internal redirect? What case?
redirect(URL()) don't work?

Facundo

unread,
Jul 5, 2016, 12:30:22 PM7/5/16
to web2py-users
Redirect makes a redirect in the client side, that is not what I need.

For example, I enter the URL /api/v0/getinfo:
In the api controller I have the functions v0, v1, v2, etc.
Each of these functions must redirect to other controller, without "telling" to the client. So inside the v0 controller I have the "getinfo" function for example.

As I said, I want exactly what LOAD does, but without the div.

Thank you!

Anthony

unread,
Jul 5, 2016, 12:57:42 PM7/5/16
to web2py-users
mypage = LOAD('mycontroller', 'myfunction', ajax=False)[0][0]

LOAD(..., ajax=False) returns TAG[''](DIV(XML(page), **attr), script), so the above indexing extracts the XML(page) element, where "page" is the page generated by myfunction. You can return it directly. (Note, TAG[''] just allows you to wrap multiple HTML helper objects without any surrounding HTML tags -- it has been deprecated in favor of CAT.)

Anthony

Facundo Médica

unread,
Jul 5, 2016, 1:05:44 PM7/5/16
to web...@googlegroups.com
Looks good for me! I'll try it out!
Thank you!

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/ycvjQfHFmuE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages