ajout des cotroleur avec template pour les entitys

This commit is contained in:
LouLocatex
2025-01-09 09:31:51 +04:00
parent 8cbe57bd31
commit 55c07b65ca
32 changed files with 864 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_plat_delete', {'id': plat.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ plat.id) }}">
<button class="btn">Delete</button>
</form>
+4
View File
@@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}
+13
View File
@@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Plat{% endblock %}
{% block body %}
<h1>Edit Plat</h1>
{{ include('plat/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_plat_index') }}">back to list</a>
{{ include('plat/_delete_form.html.twig') }}
{% endblock %}
+39
View File
@@ -0,0 +1,39 @@
{% extends 'base.html.twig' %}
{% block title %}Plat index{% endblock %}
{% block body %}
<h1>Plat index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Nom</th>
<th>Description</th>
<th>Prix</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for plat in plats %}
<tr>
<td>{{ plat.id }}</td>
<td>{{ plat.nom }}</td>
<td>{{ plat.description }}</td>
<td>{{ plat.prix }}</td>
<td>
<a href="{{ path('app_plat_show', {'id': plat.id}) }}">show</a>
<a href="{{ path('app_plat_edit', {'id': plat.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="5">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_plat_new') }}">Create new</a>
{% endblock %}
+11
View File
@@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New Plat{% endblock %}
{% block body %}
<h1>Create new Plat</h1>
{{ include('plat/_form.html.twig') }}
<a href="{{ path('app_plat_index') }}">back to list</a>
{% endblock %}
+34
View File
@@ -0,0 +1,34 @@
{% extends 'base.html.twig' %}
{% block title %}Plat{% endblock %}
{% block body %}
<h1>Plat</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ plat.id }}</td>
</tr>
<tr>
<th>Nom</th>
<td>{{ plat.nom }}</td>
</tr>
<tr>
<th>Description</th>
<td>{{ plat.description }}</td>
</tr>
<tr>
<th>Prix</th>
<td>{{ plat.prix }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_plat_index') }}">back to list</a>
<a href="{{ path('app_plat_edit', {'id': plat.id}) }}">edit</a>
{{ include('plat/_delete_form.html.twig') }}
{% endblock %}