Is you don't specify the controller in the URL() function, it assumes the
current controller, so just do:
URL('default', 'product_listing', extension=False)
Anthony
On Wednesday, December 4, 2013 1:23:15 PM UTC-5, Gael Princivalle wrote:
>
> Thanks Anthony, now web2py try to load the html file.
> In the url I have now "hp/products_listing" instead of
> "hp/products_listing.load", OK.
>
> But the controller is always the wrong one:
> invalid function (hp/products_listing)
>
> How can I ask to web2py to search for "product_listing" in the "default"
> controller instead of the "hp" controller ?
>
> Have a nice day.
>
> Il giorno mercoledì 4 dicembre 2013 18:26:24 UTC+1, Anthony ha scritto:
>>
>> The URL() function will propagate the extension of the current request
>> (which is .load in this case). To suppress the extension, do:
>>
>> URL('products_listing', extension=False)
>>
>> Anthony
>>
>> On Wednesday, December 4, 2013 12:06:44 PM UTC-5, Gael Princivalle wrote:
>>>
>>> Hello.
>>>
>>> I load a file inside a page:
>>> {{=LOAD('hp','hp.load', ajax=True, target='div_hp')}}
>>>
>>> Now inside this page I have a link to a function/view from the default
>>> controller.
>>> {{=P(A('My link', _href=URL('products_listing')))}
>>>
>>> Reply is "invalid function (hp/products_listing)"
>>> In fact web2py tries to load the 'product_listing' function/view from
>>> the current controller called hp, and not an html file but a load file:
>>> hp/products_listing.load
>>>
>>> How can I resolve this problem ? Of course I want to load the
>>> product_listing page outside the div_hp DIV.
>>>
>>> Thanks.
>>>
>>
--
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 the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.