当前位置: 首页>>代码示例>>PHP>>正文


PHP Container::build方法代码示例

本文整理汇总了PHP中Illuminate\Container\Container::build方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::build方法的具体用法?PHP Container::build怎么用?PHP Container::build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Container\Container的用法示例。


在下文中一共展示了Container::build方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: build

 public function build($concrete, array $parameters = [])
 {
     if (is_string($concrete) && in_array($concrete, array_keys($this->servicesAliasBridge))) {
         return $this->servicesAliasBridge[$concrete];
     }
     return parent::build($concrete, $parameters);
 }
开发者ID:aprezcuba24,项目名称:CULabsIlluminateBundle,代码行数:7,代码来源:Container.php

示例2: createFormRequest

 /**
  *  Creates and initializes an Form Request instance.
  *
  * @param string $class
  * @return FormRequest
  */
 protected function createFormRequest($class)
 {
     /*
      * @var $formRequest \Illuminate\Foundation\Http\FormRequest
      * @var $request Request
      */
     list($class, $params) = $this->parseFormRequestName($class);
     $request = $this->app->__get('request');
     $formRequest = $this->app->build($class, $params);
     if ($session = $request->getSession()) {
         $formRequest->setSession($session);
     }
     $formRequest->setUserResolver($request->getUserResolver());
     $formRequest->setRouteResolver($request->getRouteResolver());
     $formRequest->setContainer($this->app);
     return $formRequest;
 }
开发者ID:suhe,项目名称:bdoportal,代码行数:23,代码来源:JsValidatorFactory.php

示例3: build

 /**
  * Instantiate a concrete instance of the given type.
  *
  * @param  string $concrete
  * @param  array $parameters
  * @return mixed
  *
  * @throws BindingResolutionException
  */
 public function build($concrete, $parameters = array())
 {
     $object = parent::build($concrete, $parameters);
     if (is_object($object) && $object instanceof ApplicationAwareInterface) {
         $object->setApplication($this);
     }
     return $object;
 }
开发者ID:bobzepplin,项目名称:dodgeball,代码行数:17,代码来源:Application.php

示例4: resolveHandler

 /**
  * resolve single log handler via illuminate DI container
  *
  * @param string $handlerClassName
  * @param array $constructorArgs
  * @return HandlerInterface
  * @throws \Exception
  */
 protected function resolveHandler($handlerClassName, array $constructorArgs = [])
 {
     $handlerClassName = '\\Monolog\\Handler\\' . $handlerClassName;
     return $this->container->build($handlerClassName, $constructorArgs);
 }
开发者ID:jotweh,项目名称:codeception-monolog,代码行数:13,代码来源:CodeceptionMonolog.php


注:本文中的Illuminate\Container\Container::build方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。