Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
14955 มุมมอง

hi,

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

so how can i do that

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน

thanks it works for me

คำตอบที่ดีที่สุด

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​

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ม.ค. 20
7315
0
พ.ย. 23
1613
2
ก.ย. 20
11442
1
พ.ย. 19
8251
0
พ.ค. 19
4758