In Yii, pass PHP variables to JavaScript

前端 未结 6 680
面向向阳花
面向向阳花 2021-01-20 04:11

In my JavaScript (using jQuery) there are a whole set of PHP variables to which I need access. While I\'ve got it working by just producing the JavaScript file as a view, an

6条回答
  •  感动是毒
    2021-01-20 04:54

    The one of approaches is to set global variable by a small script and redisterScript(), and then use this variable in real js

提交回复
热议问题