connexion base et création premier crud
This commit is contained in:
4
templates/o/_delete_form.html.twig
Normal file
4
templates/o/_delete_form.html.twig
Normal file
@@ -0,0 +1,4 @@
|
||||
<form method="post" action="{{ path('app_o_delete', {'id': membre.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ membre.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
||||
4
templates/o/_form.html.twig
Normal file
4
templates/o/_form.html.twig
Normal file
@@ -0,0 +1,4 @@
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
||||
13
templates/o/edit.html.twig
Normal file
13
templates/o/edit.html.twig
Normal file
@@ -0,0 +1,13 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Membre{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Membre</h1>
|
||||
|
||||
{{ include('o/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_o_index') }}">back to list</a>
|
||||
|
||||
{{ include('o/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
37
templates/o/index.html.twig
Normal file
37
templates/o/index.html.twig
Normal file
@@ -0,0 +1,37 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Membre index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Membre index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nom</th>
|
||||
<th>Password</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for membre in membres %}
|
||||
<tr>
|
||||
<td>{{ membre.id }}</td>
|
||||
<td>{{ membre.nom }}</td>
|
||||
<td>{{ membre.password }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_o_show', {'id': membre.id}) }}">show</a>
|
||||
<a href="{{ path('app_o_edit', {'id': membre.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="4">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_o_new') }}">Create new</a>
|
||||
{% endblock %}
|
||||
11
templates/o/new.html.twig
Normal file
11
templates/o/new.html.twig
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Membre{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Membre</h1>
|
||||
|
||||
{{ include('o/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('app_o_index') }}">back to list</a>
|
||||
{% endblock %}
|
||||
30
templates/o/show.html.twig
Normal file
30
templates/o/show.html.twig
Normal file
@@ -0,0 +1,30 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Membre{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Membre</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ membre.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<td>{{ membre.nom }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Password</th>
|
||||
<td>{{ membre.password }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_o_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_o_edit', {'id': membre.id}) }}">edit</a>
|
||||
|
||||
{{ include('o/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user