Daily laravel-20160820| Contextualbinding

Source: Internet
Author: User

<?phpnamespace illuminate\container;use illuminate\contracts\container\contextualbindingbuilder  as ContextualBindingBuilderContract;class ContextualBindingBuilder implements  contextualbindingbuildercontract{    /**     * the  underlying container instance.     *     * @ var \illuminate\container\container     */    protected   $container;// the underlying container instance    /**      * The concrete instance.     *      *  @var  string     */    protected   $concrete;// a instance about concrete    /**      * the abstract target.     *     *  @var  string      */    protected  $needs;// a target about the  Abstract    /**     * create a new contextual  binding builder.     *     *  @param    \Illuminate\Container\Container   $container      *  @param    string   $concrete      *  @return  void      */    public function __construct (Container  $container,  $ Concrete)     {         $this->concrete =   $concrete;         $this->container =  $container;//  set the &nbsP;  }    /**     * define the abstract  target that depends on the context.     *      *  @param   string   $abstract      * @ return  $this      */    public function needs ($ abstract)     {         $this->needs =  $abstract;        return  $this;    }//  Function is needs    /**     * define the  implementation for the contextual binding.     *      *  @param   \Closure|string   $implementation       *  @return &nbsP;void     */    public function give ($implementation)     {         $this->container-> Addcontextualbinding ($this->concrete,  $this->needs,  $implementation);     }  define the implementation for the contextual binding}


This article is from the "Focus on PHP" blog, please be sure to keep this source http://jingshanls.blog.51cto.com/3357095/1785393

Daily laravel-20160820| Contextualbinding

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.