Skip to content

Commit d31de61

Browse files
committed
Merge branch 'master' of git://github.com/c2is/BigfootCoreBundle
2 parents c84339b + 1e34362 commit d31de61

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Crud/CrudController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ protected function doIndex()
214214
),
215215
),
216216
'actions' => array(
217-
array(
217+
'edit' => array(
218218
'href' => $this->container->get('router')->generate($this->getRouteNameForAction('edit'), array('id' => '__ID__')),
219219
'icon' => 'pencil',
220220
)

Resources/views/base.list.html.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
{% for attr, field in list_fields %}
2222
<th>{{ field | trans }}</th>
2323
{% endfor %}
24+
{% if actions|length > 0 %}
2425
<th>Actions</th>
26+
{% endif %}
2527
</tr>
2628
</thead>
2729
<tbody>
@@ -31,11 +33,15 @@
3133
<td>{{ attribute(item, attr)|nl2br }}</td>
3234
{% endfor %}
3335
{% block action_buttons %}
36+
{% if actions|length > 0 %}
3437
<td>
3538
<div class="btn-group">
36-
<a class="btn btn-link" href="{{ path(list_edit_route, { 'id': item.id }) }}"><span class="glyphicon glyphicon-pencil"></span></a>
39+
{% for action in actions %}
40+
<a class="btn btn-link" href="{{ action.href|replace({'__ID__': item.id}) }}"><span class="glyphicon glyphicon-{{ action.icon }}"></span></a>
41+
{% endfor %}
3742
</div>
3843
</td>
44+
{% endif %}
3945
{% endblock %}
4046
</tr>
4147
{% endfor %}

0 commit comments

Comments
 (0)