Home  >  Q&A  >  body text

Under the TP framework, how does the controller obtain the value on the page?

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? ?

LRTRLLRTRL2677 days ago1642

reply all(3)I'll reply

  • 清晨的那一抹阳光照耀在我的脸上

    清晨的那一抹阳光照耀在我的脸上2017-05-25 13:17:46

    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
    0
  • LRTRL

    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 · 2017-05-26 16:06:32
    清晨的那一抹阳光照耀在我的脸上

    oh oh

    清晨的那一抹阳光照耀在我的脸上 · 2017-05-27 16:29:49
  • PHP中文网

    PHP中文网2017-05-25 12:58:56

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

    reply
    2
  • 遥远的她

    1111

    遥远的她 · 2017-06-07 17:36:56
  • PHP中文网

    PHP中文网2017-05-24 17:31:44

    Add a form hidden field to pass the value.

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


    reply
    0
  • LRTRL

    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 · 2017-05-25 11:53:03
  • Cancelreply