disableSandbox example

try {
            $loaded = $env->resolveTemplate($template);
        } catch (LoaderError $e) {
            if (!$ignoreMissing) {
                throw $e;
            }
        }

        return $loaded ? $loaded->render($variables) : '';
    } finally {
        if ($isSandboxed && !$alreadySandboxed) {
            $sandbox->disableSandbox();
        }
    }
}

/** * Returns a template content without rendering it. * * @param string $name The template name * @param bool $ignoreMissing Whether to ignore missing templates or not * * @return string The template source */
Home | Imprint | This part of the site doesn't use cookies.