ajout des cotroleur avec template pour les entitys
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<form method="post" action="{{ path('app_categorie_delete', {'id': categorie.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ categorie.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
||||
@@ -0,0 +1,4 @@
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
||||
@@ -0,0 +1,13 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Categorie{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Categorie</h1>
|
||||
|
||||
{{ include('categorie/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_categorie_index') }}">back to list</a>
|
||||
|
||||
{{ include('categorie/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,35 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Categorie index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Categorie index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nom</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for categorie in categories %}
|
||||
<tr>
|
||||
<td>{{ categorie.id }}</td>
|
||||
<td>{{ categorie.nom }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_categorie_show', {'id': categorie.id}) }}">show</a>
|
||||
<a href="{{ path('app_categorie_edit', {'id': categorie.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_categorie_new') }}">Create new</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Categorie{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Categorie</h1>
|
||||
|
||||
{{ include('categorie/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('app_categorie_index') }}">back to list</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,26 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Categorie{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Categorie</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ categorie.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<td>{{ categorie.nom }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_categorie_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_categorie_edit', {'id': categorie.id}) }}">edit</a>
|
||||
|
||||
{{ include('categorie/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user