本文整理汇总了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;
}
示例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);
}
示例3: app
function app($make = null, array $parameters = [])
{
if (null === $make) {
return Container::getInstance();
}
return Container::getInstance()->make($make, $parameters);
}
示例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);
}
示例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;
}
示例6: getRequest
/**
* @return \Illuminate\Http\Request
*/
public function getRequest()
{
if (!isset($this->request)) {
$this->request = Container::getInstance()->make('request');
}
return $this->request;
}
示例7: getEvents
/**
* @return \Illuminate\Events\Dispatcher
*/
public function getEvents()
{
if (!isset($this->events)) {
$this->events = Container::getInstance()->make('events');
}
return $this->events;
}
示例8: getSetting
/**
* @return \Notadd\Setting\Factory
*/
public function getSetting()
{
if (!isset($this->setting)) {
$this->setting = Container::getInstance()->make('setting');
}
return $this->setting;
}
示例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");
}
示例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));
}
示例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;
}
示例12: getConfig
/**
* @return \Illuminate\Config\Repository
*/
public function getConfig()
{
if (!isset($this->config)) {
$this->config = Container::getInstance()->make('config');
}
return $this->config;
}
示例13: getCookie
/**
* @return \Illuminate\Cookie\CookieJar
*/
public function getCookie()
{
if (!isset($this->cookie)) {
$this->cookie = Container::getInstance()->make('cookie');
}
return $this->cookie;
}
示例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;
}
示例15: getTheme
/**
* @return \Notadd\Theme\Factory
*/
public function getTheme()
{
if (!isset($this->theme)) {
$this->theme = Container::getInstance()->make('theme');
}
return $this->theme;
}