Laravel 4.2 Input Facade

2017-01-13  本文已影响57人  一阵风fly

Laravel 4.2 可以用 Input::all() 获取所有的输入,get_class(new Input),可以找到Input位于:Illuminate/Support/Facades/Input

查看4.2的API文档,并未发现有 all 方法,查看github源代码

/**
 * Get the registered name of the component.
 *
 * @return string
 */
protected static function getFacadeAccessor() 
{ 
    return 'request'; 
}

原来是用了Laravel的门面,而且还有这么一行注释

/**
 * @see \Illuminate\Http\Request
 */

Request 里确实是有 all 方法的,所以Input可以用Request的所有方法!!

上一篇下一篇

猜你喜欢

热点阅读