public function registerHandlebarsEngine($resolver)
    {
        $app = $this->app;

        // The Compiler engine requires an instance of the CompilerInterface, which in
        // this case will be the Handlebars compiler, so we'll first create the compiler
        // instance to pass into the engine so it can compile the views properly.
        $app->singleton('handlebars.lightncandy', function ($app) {
            return new LightnCandy;
        });

        $app->singleton('handlebars.compiler', function ($app) {
            $cache = $app['config']['view.compiled'];

            return new HandlebarsCompiler($app['files'], $app['handlebars.lightncandy'], $cache);
        });

        $resolver->register('handlebars', function () use ($app) {
            return new HandlebarsEngine($app['handlebars.compiler']);
        });
    }