connexion base et création premier crud

This commit is contained in:
Logshiro
2025-10-16 17:01:43 +02:00
parent ea9a187326
commit 2e4dce40d4
38 changed files with 653 additions and 278 deletions

View File

@@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_projet_delete', {'id': projet.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ projet.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 Projet{% endblock %}
{% block body %}
<h1>Edit Projet</h1>
{{ include('projet/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_projet_index') }}">back to list</a>
{{ include('projet/_delete_form.html.twig') }}
{% endblock %}

View File

@@ -0,0 +1,35 @@
{% extends 'base.html.twig' %}
{% block title %}Projet index{% endblock %}
{% block body %}
<h1>Projet index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Nom</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for projet in projets %}
<tr>
<td>{{ projet.id }}</td>
<td>{{ projet.nom }}</td>
<td>
<a href="{{ path('app_projet_show', {'id': projet.id}) }}">show</a>
<a href="{{ path('app_projet_edit', {'id': projet.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_projet_new') }}">Create new</a>
{% endblock %}

View File

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

View File

@@ -0,0 +1,26 @@
{% extends 'base.html.twig' %}
{% block title %}Projet{% endblock %}
{% block body %}
<h1>Projet</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ projet.id }}</td>
</tr>
<tr>
<th>Nom</th>
<td>{{ projet.nom }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_projet_index') }}">back to list</a>
<a href="{{ path('app_projet_edit', {'id': projet.id}) }}">edit</a>
{{ include('projet/_delete_form.html.twig') }}
{% endblock %}