collection-crud/src/Resources/crud/templates/index.tpl.php

52 lines
1.3 KiB
PHP

<?= $helper->getHeadPrintCode($entity_class_name); ?>
{% block body %}
<h2><?= $entity_class_name ?></h2>
<div class="small callout primary">
<ul>
<li>
<a href="{{ path('<?= $route_name ?>_new') }}">Add <?= $entity_class_name ?></a>
</li>
</ul>
</div>
<table class="table">
<thead>
<tr>
<th>&nbsp;</th>
<?php foreach ($entity_fields as $field): ?>
<th><?= ucfirst($field['fieldName']) ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
{% for <?= $entity_twig_var_singular ?> in <?= $entity_twig_var_plural ?> %}
<tr>
<td>
<ul>
<li>
<a href="{{ path('<?= $route_name ?>_show', {'<?= $entity_identifier ?>': <?= $entity_twig_var_singular ?>.<?= $entity_identifier ?>}) }}">
View 👁
</a>
</li>
<li>
<a href="{{ path('<?= $route_name ?>_edit', {'<?= $entity_identifier ?>': <?= $entity_twig_var_singular ?>.<?= $entity_identifier ?>}) }}">
Edit <span class="edit-icon">&#9998;</span>
</a>
</li>
</ul>
</td>
<?php foreach ($entity_fields as $field): ?>
<td>{{ <?= $helper->getEntityFieldPrintCode($entity_twig_var_singular, $field) ?> }}</td>
<?php endforeach; ?>
</tr>
{% else %}
<tr>
<td colspan="<?= (count($entity_fields) + 1) ?>">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}