/**
  * @param Application|Container $app
  *
  */
 public function boot($app)
 {
     // only if enabled
     if ($app['config']['view.blade.enabled']) {
         // default blade context to simplify creating a new Blade|BladeView object.
         $app['blade.context'] = function ($app) {
             return new BladeConfigurationSet(['engine' => $app['blade.engine'], 'events' => $app['illuminate.events'], 'factory' => $app['blade.factory'], 'finder' => $app['view.finder'], 'global' => $app['global.scope'], 'paths' => $app['paths'], 'settings' => $app['blade.settings']]);
         };
         $this->container->add([BladeConfigurationSet::class, BladeViewConfigurationInterface::class], function () use($app) {
             return $app['blade.context'];
         });
         $this->container->add([BladeView::class, 'BladeView'], function () use($app) {
             return new BladeView($this->app['blade.context']);
         });
         // for dependency injection. ie: DI::make(BladeView::class)
         $app[BladeViewConfigurationInterface::class] = function ($app) {
             return $app['blade.context'];
         };
         $app['blade'] = $app->factory(function () {
             return new Blade($this->app['blade.context']);
         });
         $app['blade.view'] = $app->factory(function () {
             return new BladeView($this->app['blade.context']);
         });
     }
 }
 /**
  * @param Application|Container $app
  *
  */
 public function boot($app)
 {
     /** @var Forge $container */
     list($config, $container) = [$this->config, $this->container];
     // only boot if twig templates are enabled by the framework
     if ($this->config['view.twig.enabled']) {
         $app['twig.context'] = function ($app) {
             return new TwigConfigurationSet(['events' => $app['nine.events'], 'finder' => $app['twig.finder'], 'global' => $app['global.scope'], 'paths' => $app['paths'], 'settings' => $app['twig.settings']]);
         };
         $app['twig.view'] = $app->factory(function ($app) {
             return new TwigView($app['twig.context']);
         });
         $container->singleton([TwigConfigurationSet::class, TwigViewConfigurationInterface::class], function () use($app) {
             return $app['twig.context'];
         });
         $container->add([TwigView::class, 'TwigView'], function () use($app) {
             return new TwigView($app['twig.context']);
         });
     }
 }