-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass object as attribute for Twig Component
- Loading branch information
1 parent
3a7e739
commit b2b00d3
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tests/TestApplication/templates/components/Button.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
{% props icon = null %} | ||
|
||
<button {{ attributes.defaults({ class: 'text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800' }) }}> | ||
{% if icon is not null and icon.position|default == 'left' %} | ||
{{ icon.svg|raw }} | ||
{% endif %} | ||
|
||
{% block content %}{% endblock %} | ||
|
||
{% if icon is not null and icon.position|default == 'right' %} | ||
{{ icon.svg|raw }} | ||
{% endif %} | ||
</button> |