feat: added default controllers to add the header with links
feat: footer no style for now
This commit is contained in:
parent
92dfb37262
commit
4b283f383e
4
.gitignore
vendored
4
.gitignore
vendored
@ -23,3 +23,7 @@
|
||||
/public/assets/
|
||||
/assets/vendor/
|
||||
###< symfony/asset-mapper ###
|
||||
|
||||
###> vscode ###
|
||||
/.vscode
|
||||
###< vscode ###
|
@ -1,3 +1,4 @@
|
||||
body {
|
||||
background-color: skyblue;
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
18
src/Controller/ConnectController.php
Normal file
18
src/Controller/ConnectController.php
Normal 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;
|
||||
|
||||
class ConnectController extends AbstractController
|
||||
{
|
||||
#[Route('/connect', name: 'connect')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('connect/index.html.twig', [
|
||||
'controller_name' => 'ConnectController',
|
||||
]);
|
||||
}
|
||||
}
|
18
src/Controller/IndexController.php
Normal file
18
src/Controller/IndexController.php
Normal 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;
|
||||
|
||||
class IndexController extends AbstractController
|
||||
{
|
||||
#[Route('/', name: 'index')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('index.html.twig', [
|
||||
'controller_name' => 'IndexController',
|
||||
]);
|
||||
}
|
||||
}
|
18
src/Controller/SearchController.php
Normal file
18
src/Controller/SearchController.php
Normal 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;
|
||||
|
||||
class SearchController extends AbstractController
|
||||
{
|
||||
#[Route('/search', name: 'search')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('search/index.html.twig', [
|
||||
'controller_name' => 'SearchController',
|
||||
]);
|
||||
}
|
||||
}
|
@ -1,17 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||
{% block stylesheets %}
|
||||
{% endblock %}
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}{{app.title}}{% endblock %}</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||
{% block stylesheets %}{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% block importmap %}{{ importmap('app') }}{% endblock %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block header %}
|
||||
<header>
|
||||
<a href="{{url('index')}}">Frutti</a>
|
||||
<form action="{{url('search')}}" method="get">
|
||||
<input type="text" name="keywords" id="keywords" placeholder="Search">
|
||||
<input type="submit" value="search">
|
||||
</form>
|
||||
<a href="{{url('connect')}}" class="button-link">Connect</a>
|
||||
</header>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% block importmap %}{{ importmap('app') }}{% endblock %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
</body>
|
||||
|
||||
{% block body %}{% endblock %}
|
||||
|
||||
|
||||
{% block footer %}
|
||||
<footer>
|
||||
<p>Done by: Capelier 🏳️⚧️ — Rubini 💅 — Simaila 🤓</p>
|
||||
</footer>
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
20
templates/connect/index.html.twig
Normal file
20
templates/connect/index.html.twig
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Hello ConnectController!{% 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>/Volumes/Little-Disk/kap/Documents/IUT/3/S6.A.05 - Dev avancé/ProjetSymfony/src/Controller/ConnectController.php</code></li>
|
||||
<li>Your template at <code>/Volumes/Little-Disk/kap/Documents/IUT/3/S6.A.05 - Dev avancé/ProjetSymfony/templates/connect/index.html.twig</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
20
templates/index.html.twig
Normal file
20
templates/index.html.twig
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Hello IndexController!{% 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>/Volumes/Little-Disk/kap/Documents/IUT/3/S6.A.05 - Dev avancé/ProjetSymfony/src/Controller/IndexController.php</code></li>
|
||||
<li>Your template at <code>/Volumes/Little-Disk/kap/Documents/IUT/3/S6.A.05 - Dev avancé/ProjetSymfony/templates/index/index.html.twig</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
20
templates/search/index.html.twig
Normal file
20
templates/search/index.html.twig
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Hello SearchController!{% 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>/Volumes/Little-Disk/kap/Documents/IUT/3/S6.A.05 - Dev avancé/ProjetSymfony/src/Controller/SearchController.php</code></li>
|
||||
<li>Your template at <code>/Volumes/Little-Disk/kap/Documents/IUT/3/S6.A.05 - Dev avancé/ProjetSymfony/templates/search/index.html.twig</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user