diff --git a/Event/LoginButtonEvent.php b/Event/LoginButtonEvent.php index 78274be..00b4c86 100644 --- a/Event/LoginButtonEvent.php +++ b/Event/LoginButtonEvent.php @@ -27,14 +27,14 @@ class LoginButtonEvent extends Event { private $buttons = []; - public function addButton($text, $linkTarget, $style = 'default', $icon = null) + public function addButton($options) { - $this->buttons[] = [ - 'text' => $text, - 'target' => $linkTarget, - 'style' => $style, - 'icon' => $icon, - ]; + $this->buttons[] = $options + [ + 'style' => 'default', + 'icon' => null, + 'url' => null, + 'route' => null, + ]; } public function getButtons() diff --git a/Resources/views/Login/buttons.html.twig b/Resources/views/Login/buttons.html.twig index adb842b..27397cf 100644 --- a/Resources/views/Login/buttons.html.twig +++ b/Resources/views/Login/buttons.html.twig @@ -1,10 +1,10 @@
{% for button in buttons %} - - {% if icon %} - {{ icon(icon) }} + + {% if button.icon %} + {{ icon(button.icon) }} {% endif %} - {{ button.text }} + {{ button.label }} {% endfor %}