diff --git a/src/Illuminate/View/ViewServiceProvider.php b/src/Illuminate/View/ViewServiceProvider.php index c136300c0e53..c06624f82f7c 100755 --- a/src/Illuminate/View/ViewServiceProvider.php +++ b/src/Illuminate/View/ViewServiceProvider.php @@ -22,6 +22,8 @@ public function register() $this->registerViewFinder(); + $this->registerBladeCompiler(); + $this->registerEngineResolver(); } @@ -78,6 +80,20 @@ public function registerViewFinder() }); } + /** + * Register the Blade compiler implementation. + * + * @return void + */ + public function registerBladeCompiler() + { + $this->app->singleton('blade.compiler', function () { + return new BladeCompiler( + $this->app['files'], $this->app['config']['view.compiled'] + ); + }); + } + /** * Register the engine resolver instance. * @@ -133,15 +149,6 @@ public function registerPhpEngine($resolver) */ public function registerBladeEngine($resolver) { - // The Compiler engine requires an instance of the CompilerInterface, which in - // this case will be the Blade compiler, so we'll first create the compiler - // instance to pass into the engine so it can compile the views properly. - $this->app->singleton('blade.compiler', function () { - return new BladeCompiler( - $this->app['files'], $this->app['config']['view.compiled'] - ); - }); - $resolver->register('blade', function () { return new CompilerEngine($this->app['blade.compiler']); });