public function render($templateName)
    {
        try {
            return $this->twigEnvironment->render($templateName, $this->getData());
        } catch (SecurityException $e) {
            throw new SecurityException($e->getMessage(), $e->getCode(), $e);
        } catch (\Twig_Error_Runtime $e) {
            throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
        } catch (\Twig_Error_Syntax $e) {
            throw new InvalidSyntaxException($e->getMessage(), $e->getCode(), $e);
        } catch (\Twig_Error_Loader $e) {

            if ($this->ignoreUndefinedTemplateErrors && Str::contains($e->getMessage(), 'is not defined'))
            {
                return;
            }

            throw new InvalidTemplateException($e->getMessage(), $e->getCode(), $e);
        }
    }
public function render($templateName)
    {
        try {
            return $this->twigEnvironment->render($templateName, $this->getData());
        } catch (SecurityException $e) {
            throw new SecurityException($e->getMessage(), $e->getCode(), $e);
        } catch (\Twig_Error_Runtime $e) {
            throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
        } catch (\Twig_Error_Syntax $e) {
            throw new InvalidSyntaxException($e->getMessage(), $e->getCode(), $e);
        } catch (\Twig_Error_Loader $e) {

            if ($this->ignoreUndefinedTemplateErrors && Str::contains($e->getMessage(), 'is not defined'))
            {
                return;
            }

            throw new InvalidTemplateException($e->getMessage(), $e->getCode(), $e);
        }
    }
public function render ( $ templateName ) { try { return $ this -> twigEnvironment -> render ( $ templateName , $ this -> getData ( ) ) ; } catch ( SecurityException $ e ) { throw new SecurityException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } catch ( \ Twig_Error_Runtime $ e ) { throw new RuntimeException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } catch ( \ Twig_Error_Syntax $ e ) { throw new InvalidSyntaxException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } catch ( \ Twig_Error_Loader $ e ) { if ( $ this -> ignoreUndefinedTemplateErrors && Str :: contains ( $ e -> getMessage ( ) , 'is not defined' ) ) { return ; } throw new InvalidTemplateException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } }
Renders a template by name.

@param $templateName
@return string
@throws InvalidTemplateException
@throws InvalidSyntaxException
@throws RuntimeException
@throws SecurityException
Renders a template by name .