add orm and tests
This commit is contained in:
parent
a32bf4ce7d
commit
a541338909
23 changed files with 1666 additions and 23 deletions
12
templates/base.html.twig
Normal file
12
templates/base.html.twig
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||
<link rel="stylesheet" href="/static/css/water.min.css">
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
4
templates/food_vendor/_delete_form.html.twig
Normal file
4
templates/food_vendor/_delete_form.html.twig
Normal 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>
|
4
templates/food_vendor/_form.html.twig
Normal file
4
templates/food_vendor/_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/food_vendor/edit.html.twig
Normal file
13
templates/food_vendor/edit.html.twig
Normal 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 %}
|
35
templates/food_vendor/index.html.twig
Normal file
35
templates/food_vendor/index.html.twig
Normal 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 %}
|
11
templates/food_vendor/new.html.twig
Normal file
11
templates/food_vendor/new.html.twig
Normal 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 %}
|
26
templates/food_vendor/show.html.twig
Normal file
26
templates/food_vendor/show.html.twig
Normal 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 %}
|
Loading…
Add table
Add a link
Reference in a new issue