Browse Source

controlleur et template de base

master
vincent 2 months ago
parent
commit
370f0a5312
10 changed files with 1046 additions and 77 deletions
  1. +7
    -1
      composer.json
  2. +946
    -76
      composer.lock
  3. +4
    -0
      config/bundles.php
  4. +5
    -0
      config/packages/debug.yaml
  5. +8
    -0
      config/packages/twig.yaml
  6. +17
    -0
      src/Controller/HomeController.php
  7. +37
    -0
      symfony.lock
  8. +16
    -0
      templates/base.html.twig
  9. +1
    -0
      templates/home/base.html.twig
  10. +5
    -0
      templates/home/index.html.twig

+ 7
- 1
composer.json View File

@ -7,14 +7,20 @@
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"symfony/asset": "7.1.*",
"symfony/console": "7.1.*",
"symfony/dotenv": "7.1.*",
"symfony/flex": "^2",
"symfony/framework-bundle": "7.1.*",
"symfony/runtime": "7.1.*",
"symfony/yaml": "7.1.*"
"symfony/twig-bundle": "7.1.*",
"symfony/yaml": "7.1.*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
},
"require-dev": {
"symfony/debug-bundle": "7.1.*",
"symfony/maker-bundle": "^1.60"
},
"config": {
"allow-plugins": {


+ 946
- 76
composer.lock
File diff suppressed because it is too large
View File


+ 4
- 0
config/bundles.php View File

@ -2,4 +2,8 @@
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
];

+ 5
- 0
config/packages/debug.yaml View File

@ -0,0 +1,5 @@
when@dev:
debug:
# Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser.
# See the "server:dump" command to start a new server.
dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"

+ 8
- 0
config/packages/twig.yaml View File

@ -0,0 +1,8 @@
twig:
file_name_pattern: '*.twig'
globals:
title: Gestionnaire de tâches simple
when@test:
twig:
strict_variables: true

+ 17
- 0
src/Controller/HomeController.php View File

@ -0,0 +1,17 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class HomeController extends AbstractController
{
#[Route('/', name: 'app_home')]
public function index(): Response
{
return $this->render('home/index.html.twig', [
]);
}
}

+ 37
- 0
symfony.lock View File

@ -11,6 +11,18 @@
"bin/console"
]
},
"symfony/debug-bundle": {
"version": "7.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "5.3",
"ref": "5aa8aa48234c8eb6dbdd7b3cd5d791485d2cec4b"
},
"files": [
"config/packages/debug.yaml"
]
},
"symfony/flex": {
"version": "2.4",
"recipe": {
@ -42,6 +54,15 @@
"src/Kernel.php"
]
},
"symfony/maker-bundle": {
"version": "1.60",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "1.0",
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
}
},
"symfony/routing": {
"version": "7.1",
"recipe": {
@ -54,5 +75,21 @@
"config/packages/routing.yaml",
"config/routes.yaml"
]
},
"symfony/twig-bundle": {
"version": "7.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.4",
"ref": "cab5fd2a13a45c266d45a7d9337e28dee6272877"
},
"files": [
"config/packages/twig.yaml",
"templates/base.html.twig"
]
},
"twig/extra-bundle": {
"version": "v3.10.0"
}
}

+ 16
- 0
templates/base.html.twig View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{% block title %}{{ title }}{% endblock %}</title>
<link rel="icon" href="data:," />
{% block stylesheets %}
{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
{% block javascripts %}
{% endblock %}
</body>
</html>

+ 1
- 0
templates/home/base.html.twig View File

@ -0,0 +1 @@
{% extends 'base.html.twig' %}

+ 5
- 0
templates/home/index.html.twig View File

@ -0,0 +1,5 @@
{% extends 'home/base.html.twig' %}
{% block body %}
home
{% endblock %}

Loading…
Cancel
Save