ajout des cotroleur avec template pour les entitys
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<form method="post" action="{{ path('app_restaurant_delete', {'id': restaurant.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ restaurant.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 Restaurant{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Restaurant</h1>
|
||||
|
||||
{{ include('restaurant/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_restaurant_index') }}">back to list</a>
|
||||
|
||||
{{ include('restaurant/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,41 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Restaurant index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Restaurant index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nom</th>
|
||||
<th>Adresse</th>
|
||||
<th>Telephone</th>
|
||||
<th>Chef</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for restaurant in restaurants %}
|
||||
<tr>
|
||||
<td>{{ restaurant.id }}</td>
|
||||
<td>{{ restaurant.nom }}</td>
|
||||
<td>{{ restaurant.adresse }}</td>
|
||||
<td>{{ restaurant.telephone }}</td>
|
||||
<td>{{ restaurant.chef }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_restaurant_show', {'id': restaurant.id}) }}">show</a>
|
||||
<a href="{{ path('app_restaurant_edit', {'id': restaurant.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="6">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_restaurant_new') }}">Create new</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Restaurant{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Restaurant</h1>
|
||||
|
||||
{{ include('restaurant/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('app_restaurant_index') }}">back to list</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,38 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Restaurant{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Restaurant</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ restaurant.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<td>{{ restaurant.nom }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Adresse</th>
|
||||
<td>{{ restaurant.adresse }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Telephone</th>
|
||||
<td>{{ restaurant.telephone }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Chef</th>
|
||||
<td>{{ restaurant.chef }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_restaurant_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_restaurant_edit', {'id': restaurant.id}) }}">edit</a>
|
||||
|
||||
{{ include('restaurant/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user