Skip to content

Commit

Permalink
chore: try to reproduce dunglas/frankenphp#617
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Mar 1, 2024
1 parent 165eca9 commit 928cc22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Controller/HomepageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class HomepageController extends AbstractController
{
#[Route("/", name: "homepage")]
public function index(): Response
public function index(Request $request): Response
{
return $this->render('homepage/index.html.twig', [
'controller_name' => 'HomepageController',
'authorization' => $request->headers->get('Authorization'),
]);
}
}
5 changes: 4 additions & 1 deletion templates/homepage/index.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% extends 'base.html.twig' %}

{% block title %}Hello {{ controller_name }}!{% endblock %}
{% block title %}
Hello {{ controller_name }}!
Authorization: {{ authorization }}
{% endblock %}

{% block body %}
Hello {{ controller_name }}!<br/>
Expand Down

0 comments on commit 928cc22

Please sign in to comment.