本文整理汇总了PHP中Illuminate\Container\Container::afterResolving方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::afterResolving方法的具体用法?PHP Container::afterResolving怎么用?PHP Container::afterResolving使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Container\Container
的用法示例。
在下文中一共展示了Container::afterResolving方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
/**
* Set up the various view engines.
*
* @param Container $app
*/
public function boot(Container $app)
{
$app->afterResolving(function (Factory $factory, $app) {
$factory->addExtension('php', 'php', function () {
return new PhpEngine();
});
$factory->addExtension('blade.php', 'blade', function () use($app) {
return new CompilerEngine($app->make(BladeCompiler::class));
});
$factory->addExtension('md', 'markdown', function () use($app) {
return new CompilerEngine($app->make(Markdown::class));
});
});
$app->when(BladeCompiler::class)->needs('$cachePath')->give(vfsStream::setup('root/.blade')->url());
}
示例2: build
/**
* Run the build command.
*
* @return bool
*/
protected function build()
{
$container = new Container();
$container->singleton('files', Filesystem::class);
$container->bind(Factory::class, function ($app) {
return new Factory($app->make(EngineResolver::class), new FileViewFinder($app['files'], ['test/source']), new Dispatcher($app));
});
$container->afterResolving(function (Factory $factory, $app) {
$factory->addExtension('php', 'php', function () {
return new PhpEngine();
});
$factory->addExtension('blade.php', 'blade', function () use($app) {
return new CompilerEngine(new BladeCompiler($app['files'], vfsStream::url('test/.cache')));
});
});
$builder = new Builder($container, [Skip::class . ':_*', Compile::class]);
return $builder->build(vfsStream::url('test/source'), vfsStream::url('test/build'));
}
示例3: registerValidationResolverHook
/**
* Register the "ValidatesWhenResolved" container hook.
*
* @return void
*/
protected function registerValidationResolverHook()
{
$this->container->afterResolving(function (ValidatesWhenResolved $resolved) {
$resolved->validate();
});
}
示例4: boot
/**
* Set up required container bindings.
*
* @param Container $app
*/
public function boot(Container $app)
{
$app->afterResolving(function (BladeCompiler $compiler, $app) {
$this->allowHighlightTag($compiler);
});
}