protected function registerOptions()
    {
        $this->app->bindIf('twig.extension', function () {
            return $this->app['config']->get('twigbridge.twig.extension');
        });

        $this->app->bindIf('twig.options', function () {
            $options = $this->app['config']->get('twigbridge.twig.environment', []);

            // Check whether we have the cache path set
            if (!isset($options['cache']) || is_null($options['cache'])) {
                // No cache path set for Twig, lets set to the Laravel views storage folder
                $options['cache'] = storage_path('framework/views/twig');
            }

            return $options;
        });

        $this->app->bindIf('twig.extensions', function () {
            $load = $this->app['config']->get('twigbridge.extensions.enabled', []);

            // Is debug enabled?
            // If so enable debug extension
            $options = $this->app['twig.options'];
            $isDebug = (bool) (isset($options['debug'])) ? $options['debug'] : false;

            if ($isDebug) {
                array_unshift($load, DebugExtension::class);
            }

            return $load;
        });

        $this->app->bindIf('twig.lexer', function () {
            return null;
        });
    }
protected function registerOptions()
    {
        $this->app->bindIf('twig.extension', function () {
            return $this->app['config']->get('twigbridge.twig.extension');
        });

        $this->app->bindIf('twig.options', function () {
            $options = $this->app['config']->get('twigbridge.twig.environment', []);

            // Check whether we have the cache path set
            if (!isset($options['cache']) || is_null($options['cache'])) {
                // No cache path set for Twig, lets set to the Laravel views storage folder
                $options['cache'] = storage_path('framework/views/twig');
            }

            return $options;
        });

        $this->app->bindIf('twig.extensions', function () {
            $load = $this->app['config']->get('twigbridge.extensions.enabled', []);

            // Is debug enabled?
            // If so enable debug extension
            $options = $this->app['twig.options'];
            $isDebug = (bool) (isset($options['debug'])) ? $options['debug'] : false;

            if ($isDebug) {
                array_unshift($load, DebugExtension::class);
            }

            return $load;
        });

        $this->app->bindIf('twig.lexer', function () {
            return null;
        });
    }
protected function registerOptions ( ) { $ this -> app -> bindIf ( 'twig.extension' , function ( ) { return $ this -> app [ 'config' ] -> get ( 'twigbridge.twig.extension' ) ; } ) ; $ this -> app -> bindIf ( 'twig.options' , function ( ) { $ options = $ this -> app [ 'config' ] -> get ( 'twigbridge.twig.environment' , [ ] ) ; // Check whether we have the cache path set if ( ! isset ( $ options [ 'cache' ] ) || is_null ( $ options [ 'cache' ] ) ) { // No cache path set for Twig, lets set to the Laravel views storage folder $ options [ 'cache' ] = storage_path ( 'framework/views/twig' ) ; } return $ options ; } ) ; $ this -> app -> bindIf ( 'twig.extensions' , function ( ) { $ load = $ this -> app [ 'config' ] -> get ( 'twigbridge.extensions.enabled' , [ ] ) ; // Is debug enabled? // If so enable debug extension $ options = $ this -> app [ 'twig.options' ] ; $ isDebug = ( bool ) ( isset ( $ options [ 'debug' ] ) ) ? $ options [ 'debug' ] : false ; if ( $ isDebug ) { array_unshift ( $ load , DebugExtension :: class ) ; } return $ load ; } ) ; $ this -> app -> bindIf ( 'twig.lexer' , function ( ) { return null ; } ) ; }
Register Twig config option bindings.

@return void
Register Twig config option bindings .