Skip to content

Commit e479e09

Browse files
authored
Use embed with to define scoped variables
1 parent be85af1 commit e479e09

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,15 @@ Yourbase template should extends elao admin theme base:
8888
### Drop
8989

9090
```twig
91-
{% embed "@ElaoAdminTheme/components/drop.html.twig" only %}
91+
{% embed "drop.html.twig" with {
92+
menu: [
93+
{ url: '#show', label: 'Consulter' },
94+
{ url: '#edit', label: 'Éditer' },
95+
{ url: '#delete', label: 'Supprimer' },
96+
]
97+
} only %}
9298
{% block drop_direction 'left' %}
9399
{% block tooltip_direction 'top' %}
94100
{% block tooltip_label 'Choisir une action' %}
95-
{% block drop_menu %}
96-
{% set menu = [
97-
{ url: '#show', label: 'Consulter' },
98-
{ url: '#edit', label: 'Éditer' },
99-
{ url: '#delete', label: 'Supprimer' },
100-
] %}
101-
{{ parent() }}
102-
{% endblock %}
103101
{% endembed %}
104102
```

0 commit comments

Comments
 (0)