Under the TP framework, how does the controller obtain the value on the page?
LRTRL
LRTRL 2017-05-24 16:54:50
0
3
1698

I passed a value (such as id) to the view page from other places. Now I want to get the id value on the view page from the controller method corresponding to the view page. How can I get it? ?

LRTRL
LRTRL

像蜗牛一样爬行,坚信总有一天我会有属于自己的一片天!

reply all(3)
美食控

Do you mean that AJAX cannot be submitted? In this case, the js may be written incorrectly. You can post the code for everyone to refer to.

  • reply Thank you, I have found the error, because I did the web page authorization before, and something went wrong when jumping, which caused the ajax submission later not to the correct address, so I couldn't solve it.
    LRTRL author 2017-05-26 16:06:32
  • reply oh oh
洪涛

If you are getting the value from the corresponding controller in the view, then you should get it via get

Ty80

Add a form hidden field to pass the value.

<input type="hidden" name="a" id="a" value="123">


  • reply I have written this hidden field on the view page. Now I want to pass the value to the controller method for judgment when loading this page. I use ajax to pass the value, but the load event will not work. , using the submit event will not work either
    LRTRL author 2017-05-25 11:53:03
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template