laravel-5 passing variable to JavaScript

前端 未结 6 1092
慢半拍i
慢半拍i 2020-11-30 00:26

is there any ways that JavaScript can get the variable from compact controller Laravel-5.

Example: I have the code below:

   $langs = Language::all()         


        
6条回答
  •  情深已故
    2020-11-30 00:59

    Try this - https://github.com/laracasts/PHP-Vars-To-Js-Transformer Is simple way to append PHP variables to Javascript.

提交回复
热议问题