
这是 Demo :http://115.159.147.250/task
这是项目地址:https://github.com/netcan/Laravel_AJAX_CRUD,求 Star
这是预览:
1 fhefh 2016 年 8 月 17 日 先 mark 最近在学这个在 |
2 kkk330 2016 年 8 月 17 日 laravel 直接 return 默认返回的就是 json, 不用手动 response()->json(), 这点很爽 |
4 cha1 2016 年 8 月 17 日 跟踪了下源码,挺有意思的。 Laravel 的返回结果最后都会被包装成 Response 对象。 Response 的 __construct 方法里面,有这么一行 `$this->setContent($content);` 然后再看看 setContent 这个方法,很容易就明白了。 https://github.com/laravel/framework/blob/5.2/src/Illuminate/Http/Response.php#L43 这是我摘抄的部分源码: https://gist.github.com/zqhong/2b38627ab33536c7dd47c58d48731f66 |
5 xiaome 2016 年 8 月 21 日 转义一下吧。 https://ooo.0o0.ooo/2016/08/20/57b92d02d00df.png |