private static function registerViewExtension(Slim $app, Recaptcha $recaptcha)
    {
        $view = $app->view;
        if (!property_exists($view, 'parserExtensions')) {
            return;
        }

        $originalExtensions = $view->parserExtensions ?: [];
        $class = explode('\\', get_class($view));
        switch(end($class)) {
            case 'Twig':
                $view->parserExtensions = array_merge($originalExtensions, [new TwigExtension($recaptcha)]);
                break;
        }
    }
private static function registerViewExtension(Slim $app, Recaptcha $recaptcha)
    {
        $view = $app->view;
        if (!property_exists($view, 'parserExtensions')) {
            return;
        }

        $originalExtensions = $view->parserExtensions ?: [];
        $class = explode('\\', get_class($view));
        switch(end($class)) {
            case 'Twig':
                $view->parserExtensions = array_merge($originalExtensions, [new TwigExtension($recaptcha)]);
                break;
        }
    }
private static function registerViewExtension ( Slim $ app , Recaptcha $ recaptcha ) { $ view = $ app -> view ; if ( ! property_exists ( $ view , 'parserExtensions' ) ) { return ; } $ originalExtensions = $ view -> parserExtensions ? : [ ] ; $ class = explode ( '\\' , get_class ( $ view ) ) ; switch ( end ( $ class ) ) { case 'Twig' : $ view -> parserExtensions = array_merge ( $ originalExtensions , [ new TwigExtension ( $ recaptcha ) ] ) ; break ; } }
Register the available parser extension.

@param  \Slim\Slim                $app       The application instance to register with.
@param  \Wowe\Recaptcha\Recaptcha $recaptcha The Recaptcha instance to inject into the extension.
@return void
Register the available parser extension .