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


PHP Container::getInstance方法代码示例

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


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

示例1: getView

 /**
  * @return \Illuminate\View\Factory
  */
 public function getView()
 {
     if (!isset($this->view)) {
         $this->view = Container::getInstance()->make('view');
     }
     return $this->view;
 }
开发者ID:darrengopower,项目名称:framework,代码行数:10,代码来源:InjectViewTrait.php

示例2: command

 /**
  * Add a new Artisan command event to the schedule.
  *
  * @param  string  $command
  * @param  array  $parameters
  * @return \Illuminate\Console\Scheduling\Event
  */
 public function command($command, array $parameters = [])
 {
     if (class_exists($command)) {
         $command = Container::getInstance()->make($command)->getName();
     }
     return $this->exec(Application::formatCommandString($command), $parameters);
 }
开发者ID:scrubmx,项目名称:framework,代码行数:14,代码来源:Schedule.php

示例3: app

 function app($make = null, array $parameters = [])
 {
     if (null === $make) {
         return Container::getInstance();
     }
     return Container::getInstance()->make($make, $parameters);
 }
开发者ID:laravel-commode,项目名称:bladed,代码行数:7,代码来源:functions.php

示例4: app

 /**
  * Get the available container instance.
  *
  * @param  string  $make
  * @param  array   $parameters
  * @return mixed|\Illuminate\Foundation\Application
  */
 function app($make = null, $parameters = [])
 {
     if (is_null($make)) {
         return Container::getInstance();
     }
     return Container::getInstance()->make($make, $parameters);
 }
开发者ID:RJacksonm1,项目名称:laravel-framework-for-54,代码行数:14,代码来源:helpers.php

示例5: __construct

 /**
  * Theme constructor.
  * @param $title
  * @param $alias
  */
 public function __construct($title, $alias)
 {
     $this->alias = $alias;
     $this->application = Container::getInstance();
     $this->setting = $this->application->make('setting');
     $this->title = $title;
 }
开发者ID:darrengopower,项目名称:framework,代码行数:12,代码来源:Theme.php

示例6: getRequest

 /**
  * @return \Illuminate\Http\Request
  */
 public function getRequest()
 {
     if (!isset($this->request)) {
         $this->request = Container::getInstance()->make('request');
     }
     return $this->request;
 }
开发者ID:darrengopower,项目名称:framework,代码行数:10,代码来源:InjectRequestTrait.php

示例7: getEvents

 /**
  * @return \Illuminate\Events\Dispatcher
  */
 public function getEvents()
 {
     if (!isset($this->events)) {
         $this->events = Container::getInstance()->make('events');
     }
     return $this->events;
 }
开发者ID:darrengopower,项目名称:framework,代码行数:10,代码来源:InjectEventsTrait.php

示例8: getSetting

 /**
  * @return \Notadd\Setting\Factory
  */
 public function getSetting()
 {
     if (!isset($this->setting)) {
         $this->setting = Container::getInstance()->make('setting');
     }
     return $this->setting;
 }
开发者ID:darrengopower,项目名称:framework,代码行数:10,代码来源:InjectSettingTrait.php

示例9: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     $container = \Illuminate\Container\Container::getInstance();
     $container->singleton('tckimlik', 'MuratUnal\\TcKimlik\\TcKimlik');
     $loader = \Illuminate\Foundation\AliasLoader::getInstance();
     $loader->alias('TcKimlik', "MuratUnal\\TcKimlik\\Laravel\\Facade\\TcKimlik");
 }
开发者ID:muratunal,项目名称:tckimlik,代码行数:12,代码来源:TCKimlikServiceProvider.php

示例10: resolve

 /**
  * Add a command, resolving through the application.
  *
  * @param string $command
  *
  * @return \Symfony\Component\Console\Command\Command
  */
 public function resolve($command)
 {
     if (is_null($this->container)) {
         $this->container = Container::getInstance();
     }
     return $this->add($this->container->make($command));
 }
开发者ID:notadd,项目名称:framework,代码行数:14,代码来源:Application.php

示例11: getContainer

 /**
  * Returns the IoC container.
  *
  * @return \Illuminate\Container\Container
  */
 public function getContainer()
 {
     if (!isset($this->container)) {
         $this->app = $this->container = \Illuminate\Container\Container::getInstance();
     }
     return $this->container;
 }
开发者ID:codexproject,项目名称:core,代码行数:12,代码来源:ContainerTrait.php

示例12: getConfig

 /**
  * @return \Illuminate\Config\Repository
  */
 public function getConfig()
 {
     if (!isset($this->config)) {
         $this->config = Container::getInstance()->make('config');
     }
     return $this->config;
 }
开发者ID:darrengopower,项目名称:framework,代码行数:10,代码来源:InjectConfigTrait.php

示例13: getCookie

 /**
  * @return \Illuminate\Cookie\CookieJar
  */
 public function getCookie()
 {
     if (!isset($this->cookie)) {
         $this->cookie = Container::getInstance()->make('cookie');
     }
     return $this->cookie;
 }
开发者ID:darrengopower,项目名称:framework,代码行数:10,代码来源:InjectCookieTrait.php

示例14: getBlade

 /**
  * @return \Illuminate\View\Compilers\BladeCompiler
  */
 public function getBlade()
 {
     if (!isset($this->blade)) {
         $this->blade = Container::getInstance()->make('view')->getEngineResolver()->resolve('blade')->getCompiler();
     }
     return $this->blade;
 }
开发者ID:darrengopower,项目名称:framework,代码行数:10,代码来源:InjectBladeTrait.php

示例15: getTheme

 /**
  * @return \Notadd\Theme\Factory
  */
 public function getTheme()
 {
     if (!isset($this->theme)) {
         $this->theme = Container::getInstance()->make('theme');
     }
     return $this->theme;
 }
开发者ID:darrengopower,项目名称:framework,代码行数:10,代码来源:InjectThemeTrait.php


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