connexion base et création premier crud
This commit is contained in:
4
templates/projet/_delete_form.html.twig
Normal file
4
templates/projet/_delete_form.html.twig
Normal 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>
|
||||
4
templates/projet/_form.html.twig
Normal file
4
templates/projet/_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/projet/edit.html.twig
Normal file
13
templates/projet/edit.html.twig
Normal 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 %}
|
||||
35
templates/projet/index.html.twig
Normal file
35
templates/projet/index.html.twig
Normal 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 %}
|
||||
11
templates/projet/new.html.twig
Normal file
11
templates/projet/new.html.twig
Normal 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 %}
|
||||
26
templates/projet/show.html.twig
Normal file
26
templates/projet/show.html.twig
Normal 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 %}
|
||||
Reference in New Issue
Block a user