guest
// line 1
echo "<h1>Hello World!</h1>
";
// line 3
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["user"]) || array_key_exists("user", $context) ? $context["user"] : (function () { throw new Twig_Error_Runtime('Variable "user" does not exist.', 3, $this->source); })()), "username", array()), "html", null, true);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
protected function render($view, array $parameters = array(), Response $response = null)
{
if ($this->container->has('templating')) {
$content = $this->container->get('templating')->render($view, $parameters);
} elseif ($this->container->has('twig')) {
$content = $this->container->get('twig')->render($view, $parameters);
} else {
throw new \LogicException('You can not use the "render" method if the Templating Component or the Twig Bundle are not available. Try running "composer require symfony/twig-bundle".');
}
if (null === $response) {
$this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS, $event);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = \call_user_func_array($controller, $arguments);
// view
if (!$response instanceof Response) {
$event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
$this->dispatcher->dispatch(KernelEvents::VIEW, $event);
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$request->headers->set('X-Php-Ob-Level', ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
Twig_Error_Runtime |
---|
Twig_Error_Runtime: Impossible to access an attribute ("username") on a null variable. at templates/hello.html.twig:3 at twig_get_attribute(object(Twig_Environment), object(Twig_Source), null, 'username', array()) (var/cache/dev/twig/93/93424119945f1aa72d47dd3a00b060cee7e4a1556fd3bbf608d99a1b7863da7e.php:30) at __TwigTemplate_4aad86580d9dfbaf814d2d0fd0cf8499ec19a50826abdac06fadb0c0964c0cb6->doDisplay(array('user' => null, 'app' => object(AppVariable)), array()) (vendor/twig/twig/lib/Twig/Template.php:390) at Twig_Template->displayWithErrorHandling(array('user' => null, 'app' => object(AppVariable)), array()) (vendor/twig/twig/lib/Twig/Template.php:367) at Twig_Template->display(array('user' => null)) (vendor/twig/twig/lib/Twig/Template.php:375) at Twig_Template->render(array('user' => null)) (vendor/twig/twig/lib/Twig/Environment.php:289) at Twig_Environment->render('hello.html.twig', array('user' => null)) (vendor/symfony/framework-bundle/Controller/ControllerTrait.php:286) at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('hello.html.twig', array('user' => null)) (src/Controller/SimpleController.php:37) at App\Controller\SimpleController->index(object(Request)) (vendor/symfony/http-kernel/HttpKernel.php:151) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1') (vendor/symfony/http-kernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true) (vendor/symfony/http-kernel/Kernel.php:200) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (public/index.php:25) |