美文网首页
Laravel 4.2 Input Facade

Laravel 4.2 Input Facade

作者: 一阵风fly | 来源:发表于2017-01-13 13:51 被阅读57次

    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的所有方法!!

    相关文章

      网友评论

          本文标题:Laravel 4.2 Input Facade

          本文链接:https://www.haomeiwen.com/subject/btksbttx.html