コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
15265 ビュー

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​

アバター
破棄
関連投稿 返信 ビュー 活動
2
1月 20
7551
0
11月 23
1915
2
9月 20
11860
1
11月 19
8584
0
5月 19
5028