Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
如果要直接将对象传递到JavaScript,则可以使用laracasts/Utilities软件包。
laracasts/Utilities
composer require laracasts/utilities
然后在config/app.php中添加一行,
// config/app.php 'providers' => [ '...', 'Laracasts\Utilities\JavaScript\JavaScriptServiceProvider' ];
您可以将对象传递到这样的JavaScript
use JavaScript; public function index() { JavaScript::put([ 'count' => Helper::reaction_count($id,$reaction) ]); ... }
以获取更多信息,请在此处查看https://github.com/laracasts/laracasts/php-vars-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-y一下变压器
If you want to pass object to Javascript from laravel directly then you can use laracasts/utilities package.
laracasts/utilities
Then add a line in config/app.php
You can pass object to javascript like this
For more information, please check herehttps://github.com/laracasts/PHP-Vars-To-Js-Transformer
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
如果要直接将对象传递到JavaScript,则可以使用
laracasts/Utilities
软件包。然后在config/app.php中添加一行,
您可以将对象传递到这样的JavaScript
以获取更多信息,请在此处查看
https://github.com/laracasts/laracasts/php-vars-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-js-y一下变压器
If you want to pass object to Javascript from laravel directly then you can use
laracasts/utilities
package.Then add a line in config/app.php
You can pass object to javascript like this
For more information, please check here
https://github.com/laracasts/PHP-Vars-To-Js-Transformer