add orm and tests

This commit is contained in:
lubiana 2024-06-10 20:22:44 +02:00
parent a32bf4ce7d
commit a541338909
No known key found for this signature in database
23 changed files with 1666 additions and 23 deletions

View file

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

View file

@ -0,0 +1,35 @@
{% extends 'base.html.twig' %}
{% block title %}FoodVendor index{% endblock %}
{% block body %}
<h1>FoodVendor index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for food_vendor in food_vendors %}
<tr>
<td>{{ food_vendor.id }}</td>
<td>{{ food_vendor.name }}</td>
<td>
<a href="{{ path('app_food_vendor_show', {'id': food_vendor.id}) }}">show</a>
<a href="{{ path('app_food_vendor_edit', {'id': food_vendor.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_food_vendor_new') }}">Create new</a>
{% endblock %}

View file

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

View file

@ -0,0 +1,26 @@
{% extends 'base.html.twig' %}
{% block title %}FoodVendor{% endblock %}
{% block body %}
<h1>FoodVendor</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ food_vendor.id }}</td>
</tr>
<tr>
<th>Name</th>
<td>{{ food_vendor.name }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_food_vendor_index') }}">back to list</a>
<a href="{{ path('app_food_vendor_edit', {'id': food_vendor.id}) }}">edit</a>
{{ include('food_vendor/_delete_form.html.twig') }}
{% endblock %}