Controller pour Reservations StatutCommandes,StatutTables et Tables avec le form et templates.

This commit is contained in:
leroyv 2024-11-21 14:28:29 +01:00
parent b51a75285a
commit 61adedb824
35 changed files with 951 additions and 0 deletions

View File

@ -0,0 +1,78 @@
<?php
namespace App\Controller;
use App\Entity\Plats;
use App\Form\PlatType;
use App\Form\StatutCommandeType;
use App\Repository\PlatsRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\HttpFoundation\Request;
#[Route('/plats', name: 'app_plat')]
class PlatController extends AbstractController
{
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly PlatsRepository $platsRepository
)
{
}
#[Route('/add', name: '_add')]
public function add(Request $request): Response
{
$plat = new Plats();
$form = $this->createForm(PlatType::class, $plat);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->entityManager->persist($plat);
$this->entityManager->flush();
}
return $this->render('plat/add.html.twig', [
'formAdd' => $form,
]);
}
#[Route('/list', name: '_list')]
public function list(): Response
{
$plat = $this->platsRepository->findAll();
return $this->render('plat/list.html.twig', [
'plat' => $plat,
]);
}
#[Route('/update/{id}', name: '_update')]
public function update(int $id, Request $request): Response
{
$plat = $this->platsRepository->find($id);
$form = $this->createForm(PlatType::class, $plat);
$form->handleRequest($request);
if($form->isSubmitted() && $form->isValid())
{
$this->entityManager->persist($plat);
$this->entityManager->flush();
}
return $this->render('plat/add.html.twig', [
'formAdd' => $form,
]);
}
#[Route('/delete/{id}', name: '_delete')]
public function delete(int $id): Response
{
$statutCommandes = $this->platsRepository->find($id);
$this->entityManager->remove($statutCommandes);
$this->entityManager->flush();
return $this->redirectToRoute('app_plat_list');
}
}

View File

@ -0,0 +1,81 @@
<?php
namespace App\Controller;
use App\Entity\Reservations;
use App\Form\ReservationsType;
use App\Repository\ReservationsRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/reservations')]
final class ReservationsController extends AbstractController
{
#[Route(name: 'app_reservations_index', methods: ['GET'])]
public function index(ReservationsRepository $reservationsRepository): Response
{
return $this->render('reservations/index.html.twig', [
'reservations' => $reservationsRepository->findAll(),
]);
}
#[Route('/new', name: 'app_reservations_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$reservation = new Reservations();
$form = $this->createForm(ReservationsType::class, $reservation);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($reservation);
$entityManager->flush();
return $this->redirectToRoute('app_reservations_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('reservations/new.html.twig', [
'reservation' => $reservation,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_reservations_show', methods: ['GET'])]
public function show(Reservations $reservation): Response
{
return $this->render('reservations/show.html.twig', [
'reservation' => $reservation,
]);
}
#[Route('/{id}/edit', name: 'app_reservations_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Reservations $reservation, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(ReservationsType::class, $reservation);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_reservations_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('reservations/edit.html.twig', [
'reservation' => $reservation,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_reservations_delete', methods: ['POST'])]
public function delete(Request $request, Reservations $reservation, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$reservation->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($reservation);
$entityManager->flush();
}
return $this->redirectToRoute('app_reservations_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -0,0 +1,81 @@
<?php
namespace App\Controller;
use App\Entity\StatutCommandes;
use App\Form\StatutCommandesType;
use App\Repository\StatutCommandesRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/statut/commandes')]
final class StatutCommandesController extends AbstractController
{
#[Route(name: 'app_statut_commandes_index', methods: ['GET'])]
public function index(StatutCommandesRepository $statutCommandesRepository): Response
{
return $this->render('statut_commandes/index.html.twig', [
'statut_commandes' => $statutCommandesRepository->findAll(),
]);
}
#[Route('/new', name: 'app_statut_commandes_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$statutCommande = new StatutCommandes();
$form = $this->createForm(StatutCommandesType::class, $statutCommande);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($statutCommande);
$entityManager->flush();
return $this->redirectToRoute('app_statut_commandes_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('statut_commandes/new.html.twig', [
'statut_commande' => $statutCommande,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_statut_commandes_show', methods: ['GET'])]
public function show(StatutCommandes $statutCommande): Response
{
return $this->render('statut_commandes/show.html.twig', [
'statut_commande' => $statutCommande,
]);
}
#[Route('/{id}/edit', name: 'app_statut_commandes_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, StatutCommandes $statutCommande, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(StatutCommandesType::class, $statutCommande);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_statut_commandes_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('statut_commandes/edit.html.twig', [
'statut_commande' => $statutCommande,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_statut_commandes_delete', methods: ['POST'])]
public function delete(Request $request, StatutCommandes $statutCommande, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$statutCommande->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($statutCommande);
$entityManager->flush();
}
return $this->redirectToRoute('app_statut_commandes_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -0,0 +1,81 @@
<?php
namespace App\Controller;
use App\Entity\StatutTables;
use App\Form\StatutTablesType;
use App\Repository\StatutTablesRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/statut/tables')]
final class StatutTablesController extends AbstractController
{
#[Route(name: 'app_statut_tables_index', methods: ['GET'])]
public function index(StatutTablesRepository $statutTablesRepository): Response
{
return $this->render('statut_tables/index.html.twig', [
'statut_tables' => $statutTablesRepository->findAll(),
]);
}
#[Route('/new', name: 'app_statut_tables_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$statutTable = new StatutTables();
$form = $this->createForm(StatutTablesType::class, $statutTable);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($statutTable);
$entityManager->flush();
return $this->redirectToRoute('app_statut_tables_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('statut_tables/new.html.twig', [
'statut_table' => $statutTable,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_statut_tables_show', methods: ['GET'])]
public function show(StatutTables $statutTable): Response
{
return $this->render('statut_tables/show.html.twig', [
'statut_table' => $statutTable,
]);
}
#[Route('/{id}/edit', name: 'app_statut_tables_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, StatutTables $statutTable, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(StatutTablesType::class, $statutTable);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_statut_tables_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('statut_tables/edit.html.twig', [
'statut_table' => $statutTable,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_statut_tables_delete', methods: ['POST'])]
public function delete(Request $request, StatutTables $statutTable, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$statutTable->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($statutTable);
$entityManager->flush();
}
return $this->redirectToRoute('app_statut_tables_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -0,0 +1,81 @@
<?php
namespace App\Controller;
use App\Entity\Tables;
use App\Form\TablesType;
use App\Repository\TablesRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/tables')]
final class TablesController extends AbstractController
{
#[Route(name: 'app_tables_index', methods: ['GET'])]
public function index(TablesRepository $tablesRepository): Response
{
return $this->render('tables/index.html.twig', [
'tables' => $tablesRepository->findAll(),
]);
}
#[Route('/new', name: 'app_tables_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$table = new Tables();
$form = $this->createForm(TablesType::class, $table);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($table);
$entityManager->flush();
return $this->redirectToRoute('app_tables_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('tables/new.html.twig', [
'table' => $table,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_tables_show', methods: ['GET'])]
public function show(Tables $table): Response
{
return $this->render('tables/show.html.twig', [
'table' => $table,
]);
}
#[Route('/{id}/edit', name: 'app_tables_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Tables $table, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(TablesType::class, $table);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_tables_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('tables/edit.html.twig', [
'table' => $table,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_tables_delete', methods: ['POST'])]
public function delete(Request $request, Tables $table, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$table->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($table);
$entityManager->flush();
}
return $this->redirectToRoute('app_tables_index', [], Response::HTTP_SEE_OTHER);
}
}

24
src/Form/PlatType.php Normal file
View File

@ -0,0 +1,24 @@
<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class PlatType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('field_name')
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}

View File

@ -0,0 +1,40 @@
<?php
namespace App\Form;
use App\Entity\Reservations;
use App\Entity\Tables;
use App\Entity\Utilisateurs;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ReservationsType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('DateHeure', null, [
'widget' => 'single_text',
])
->add('Nb_de_prsn')
->add('tables', EntityType::class, [
'class' => Tables::class,
'choice_label' => 'id',
])
->add('utilisateurs', EntityType::class, [
'class' => Utilisateurs::class,
'choice_label' => 'id',
'multiple' => true,
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Reservations::class,
]);
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Form;
use App\Entity\StatutCommandes;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class StatutCommandesType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('Libelle')
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => StatutCommandes::class,
]);
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace App\Form;
use App\Entity\StatutTables;
use App\Entity\Tables;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class StatutTablesType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('Libellé')
->add('tables', EntityType::class, [
'class' => Tables::class,
'choice_label' => 'id',
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => StatutTables::class,
]);
}
}

37
src/Form/TablesType.php Normal file
View File

@ -0,0 +1,37 @@
<?php
namespace App\Form;
use App\Entity\Clients;
use App\Entity\Tables;
use App\Entity\Utilisateurs;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class TablesType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('Clients', EntityType::class, [
'class' => Clients::class,
'choice_label' => 'id',
'multiple' => true,
])
->add('utilisateurs', EntityType::class, [
'class' => Utilisateurs::class,
'choice_label' => 'id',
'multiple' => true,
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Tables::class,
]);
}
}

View File

@ -0,0 +1,20 @@
{% extends 'base.html.twig' %}
{% block title %}Hello PlatController!{% 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>/home/leroyv@stsio.lan/SLAM/FestinHegre/src/Controller/PlatController.php</code></li>
<li>Your template at <code>/home/leroyv@stsio.lan/SLAM/FestinHegre/templates/plat/index.html.twig</code></li>
</ul>
</div>
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_reservations_delete', {'id': reservation.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ reservation.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Reservations{% endblock %}
{% block body %}
<h1>Edit Reservations</h1>
{{ include('reservations/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_reservations_index') }}">back to list</a>
{{ include('reservations/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,37 @@
{% extends 'base.html.twig' %}
{% block title %}Reservations index{% endblock %}
{% block body %}
<h1>Reservations index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>DateHeure</th>
<th>Nb_de_prsn</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for reservation in reservations %}
<tr>
<td>{{ reservation.id }}</td>
<td>{{ reservation.DateHeure ? reservation.DateHeure|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ reservation.NbDePrsn }}</td>
<td>
<a href="{{ path('app_reservations_show', {'id': reservation.id}) }}">show</a>
<a href="{{ path('app_reservations_edit', {'id': reservation.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_reservations_new') }}">Create new</a>
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New Reservations{% endblock %}
{% block body %}
<h1>Create new Reservations</h1>
{{ include('reservations/_form.html.twig') }}
<a href="{{ path('app_reservations_index') }}">back to list</a>
{% endblock %}

View File

@ -0,0 +1,30 @@
{% extends 'base.html.twig' %}
{% block title %}Reservations{% endblock %}
{% block body %}
<h1>Reservations</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ reservation.id }}</td>
</tr>
<tr>
<th>DateHeure</th>
<td>{{ reservation.DateHeure ? reservation.DateHeure|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>Nb_de_prsn</th>
<td>{{ reservation.NbDePrsn }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_reservations_index') }}">back to list</a>
<a href="{{ path('app_reservations_edit', {'id': reservation.id}) }}">edit</a>
{{ include('reservations/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_statut_commandes_delete', {'id': statut_commande.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ statut_commande.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit StatutCommandes{% endblock %}
{% block body %}
<h1>Edit StatutCommandes</h1>
{{ include('statut_commandes/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_statut_commandes_index') }}">back to list</a>
{{ include('statut_commandes/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,35 @@
{% extends 'base.html.twig' %}
{% block title %}StatutCommandes index{% endblock %}
{% block body %}
<h1>StatutCommandes index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Libelle</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for statut_commande in statut_commandes %}
<tr>
<td>{{ statut_commande.id }}</td>
<td>{{ statut_commande.Libelle }}</td>
<td>
<a href="{{ path('app_statut_commandes_show', {'id': statut_commande.id}) }}">show</a>
<a href="{{ path('app_statut_commandes_edit', {'id': statut_commande.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_statut_commandes_new') }}">Create new</a>
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New StatutCommandes{% endblock %}
{% block body %}
<h1>Create new StatutCommandes</h1>
{{ include('statut_commandes/_form.html.twig') }}
<a href="{{ path('app_statut_commandes_index') }}">back to list</a>
{% endblock %}

View File

@ -0,0 +1,26 @@
{% extends 'base.html.twig' %}
{% block title %}StatutCommandes{% endblock %}
{% block body %}
<h1>StatutCommandes</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ statut_commande.id }}</td>
</tr>
<tr>
<th>Libelle</th>
<td>{{ statut_commande.Libelle }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_statut_commandes_index') }}">back to list</a>
<a href="{{ path('app_statut_commandes_edit', {'id': statut_commande.id}) }}">edit</a>
{{ include('statut_commandes/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_statut_tables_delete', {'id': statut_table.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ statut_table.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit StatutTables{% endblock %}
{% block body %}
<h1>Edit StatutTables</h1>
{{ include('statut_tables/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_statut_tables_index') }}">back to list</a>
{{ include('statut_tables/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,35 @@
{% extends 'base.html.twig' %}
{% block title %}StatutTables index{% endblock %}
{% block body %}
<h1>StatutTables index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Libellé</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for statut_table in statut_tables %}
<tr>
<td>{{ statut_table.id }}</td>
<td>{{ statut_table.Libellé }}</td>
<td>
<a href="{{ path('app_statut_tables_show', {'id': statut_table.id}) }}">show</a>
<a href="{{ path('app_statut_tables_edit', {'id': statut_table.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_statut_tables_new') }}">Create new</a>
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New StatutTables{% endblock %}
{% block body %}
<h1>Create new StatutTables</h1>
{{ include('statut_tables/_form.html.twig') }}
<a href="{{ path('app_statut_tables_index') }}">back to list</a>
{% endblock %}

View File

@ -0,0 +1,26 @@
{% extends 'base.html.twig' %}
{% block title %}StatutTables{% endblock %}
{% block body %}
<h1>StatutTables</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ statut_table.id }}</td>
</tr>
<tr>
<th>Libellé</th>
<td>{{ statut_table.Libellé }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_statut_tables_index') }}">back to list</a>
<a href="{{ path('app_statut_tables_edit', {'id': statut_table.id}) }}">edit</a>
{{ include('statut_tables/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_tables_delete', {'id': table.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ table.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Tables{% endblock %}
{% block body %}
<h1>Edit Tables</h1>
{{ include('tables/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_tables_index') }}">back to list</a>
{{ include('tables/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,33 @@
{% extends 'base.html.twig' %}
{% block title %}Tables index{% endblock %}
{% block body %}
<h1>Tables index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for table in tables %}
<tr>
<td>{{ table.id }}</td>
<td>
<a href="{{ path('app_tables_show', {'id': table.id}) }}">show</a>
<a href="{{ path('app_tables_edit', {'id': table.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="2">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_tables_new') }}">Create new</a>
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New Tables{% endblock %}
{% block body %}
<h1>Create new Tables</h1>
{{ include('tables/_form.html.twig') }}
<a href="{{ path('app_tables_index') }}">back to list</a>
{% endblock %}

View File

@ -0,0 +1,22 @@
{% extends 'base.html.twig' %}
{% block title %}Tables{% endblock %}
{% block body %}
<h1>Tables</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ table.id }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_tables_index') }}">back to list</a>
<a href="{{ path('app_tables_edit', {'id': table.id}) }}">edit</a>
{{ include('tables/_delete_form.html.twig') }}
{% endblock %}