Feat: Erstellt RootController und zugehörige Template-View

This commit is contained in:
2026-06-11 18:26:43 +02:00
parent ef45866bb0
commit e8020ea334
2 changed files with 38 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
final class RootController extends AbstractController
{
#[Route('/', name: 'app_root')]
public function index(): Response
{
return $this->render('root/root.html.twig, [
'controller_name' => 'RootController',
]);
}
}
+20
View File
@@ -0,0 +1,20 @@
{% extends 'base.html.twig' %}
{% block title %}Hello RootController!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code>/var/www/html/src/Controller/RootController.php</code></li>
<li>Your template at <code>/var/www/html/templates/root/index.html.twig</code></li>
</ul>
</div>
{% endblock %}