Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
15282 Lượt xem

hi,

i want to make one controller in that i want to access querystring from that url

so how can i do that

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi


FROM CONTROLLER

if you déclare thé controller with:


def my_route(self, named_param, **kw)

     print named_param

     print kw.get('another_param')


And browse it with:

my_website/my_route?named_param=foo&another_param=bar


will output:

    foo

    bar


FROM QWEB


<t t-esc="request.params.get('another_param')" />




You can find more détails un the documentation: 

https://www.odoo.com/documentation/10.0/reference/http.html

Ảnh đại diện
Huỷ bỏ
Tác giả

thanks it works for me

Câu trả lời hay nhất

I have a problem if the foo is an object, how do I write in the url to call?
my_website/my_route?named_param=foo&another_param=bar​

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 1 20
7576
0
thg 11 23
1938
2
thg 9 20
11897
1
thg 11 19
8611
0
thg 5 19
5076