[请益] laravel request->all()

楼主: robinnpca (rob)   2018-03-17 12:05:26
解决了但想请问为何?
用 $search_all['name'] 就可在view中读到
不过想请问的是
为何范例都是 request->all() 然后$search_all->name
为何网上的介绍是这样写的?
Retrieving Input Via Dynamic Properties
You may also access user input using dynamic properties on the
Illuminate\Http\Request instance. For example, if one of your application's
forms contains a name field, you may access the value of the field like so:
$name = $request->name;
When using dynamic properties, Laravel will first look for the parameter's
value in the request payload. If it is not present, Laravel will search for
the field in the route parameters.
作者: y2468101216 (芸)   2018-03-17 13:54:00
你去看request all回传的就知道了他回传的是array而非obj

Links booklink

Contact Us: admin [ a t ] ucptt.com