connexion base et création premier crud

This commit is contained in:
Logshiro
2025-10-16 13:37:35 +02:00
parent 521d0a2d61
commit ea9a187326
38 changed files with 953 additions and 2 deletions

View File

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

View File

@@ -0,0 +1,35 @@
{% extends 'base.html.twig' %}
{% block title %}Droit index{% endblock %}
{% block body %}
<h1>Droit index</h1>
<table class="table">
<thead>
<tr>
<th>IdDroit</th>
<th>LibDroit</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for droit in droits %}
<tr>
<td>{{ droit.idDroit }}</td>
<td>{{ droit.libDroit }}</td>
<td>
<a href="{{ path('app_droit_show', {'idDroit': droit.idDroit}) }}">show</a>
<a href="{{ path('app_droit_edit', {'idDroit': droit.idDroit}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_droit_new') }}">Create new</a>
{% endblock %}

View File

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

View File

@@ -0,0 +1,26 @@
{% extends 'base.html.twig' %}
{% block title %}Droit{% endblock %}
{% block body %}
<h1>Droit</h1>
<table class="table">
<tbody>
<tr>
<th>IdDroit</th>
<td>{{ droit.idDroit }}</td>
</tr>
<tr>
<th>LibDroit</th>
<td>{{ droit.libDroit }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_droit_index') }}">back to list</a>
<a href="{{ path('app_droit_edit', {'idDroit': droit.idDroit}) }}">edit</a>
{{ include('droit/_delete_form.html.twig') }}
{% endblock %}