Home  >  Q&A  >  body text

Thinkphp5.0 view uses js to obtain session value problem

求助大神们~有用tp的大神?

2019-02-24_174807.pngIn the background, the array data is obtained through Db database query~and then spliced ​​into characters and stored in the session~
2019-02-24_175218.pngBut when the view is obtained using js, an Uncaught ReferenceError: *** is not defined~ I interpreted it as function output~
Attached is the code~Does anyone know?

HWL_SCHHWL_SCH2035 days ago1155

reply all(2)I'll reply

  • 韦小宝

    韦小宝2019-02-26 09:22:13

    In fact, there is another way to find out the value of the session directly in the controller and pass it to the view. This will make rendering much more convenient

    reply
    0
  • Cancelreply