當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。