本文整理汇总了PHP中Illuminate\Container\Container::bindShared方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::bindShared方法的具体用法?PHP Container::bindShared怎么用?PHP Container::bindShared使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Container\Container
的用法示例。
在下文中一共展示了Container::bindShared方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerViewFinder
/**
* Register the view finder implementation.
*
* @return void
*/
protected function registerViewFinder()
{
$container = $this->container;
$this->container->bindShared('view.finder', function ($app) use($container) {
return new FileViewFinder($app['files'], $container['view.paths']);
});
}
示例2: registerViewFinder
/**
* Register the view finder implementation.
*
* @return void
*/
protected function registerViewFinder()
{
$self = $this;
$this->app->bindShared('view.finder', function ($app) use($self) {
return new FileViewFinder($app['files'], $self->viewPaths);
});
}
示例3: registerViewFinder
/**
* Register the view finder implementation.
*
* @return void
*/
public function registerViewFinder()
{
$me = $this;
$this->container->bindShared('view.finder', function ($app) use($me) {
$paths = $me->viewPaths;
return new FileViewFinder($app['files'], $paths);
});
}
示例4: bindLasset
protected function bindLasset(Container $app)
{
// Load default config from /config/config.php
$app['config']->package('rmasters/lasset', __DIR__ . '/../config');
$app->bindShared(self::MANAGER_KEY, function ($app) {
$manager = new Manager($app['config']->get('lasset'));
if (is_null($manager->getDefault()) && $manager->hasEnvironment($app['env'])) {
$manager->setDefault($app['env']);
}
return $manager;
});
}