Skip to content

Commit 29f2267

Browse files
committedNov 29, 2024
bug #6604 Allow use of ux-icons in form fields (andersonamuller)
This PR was merged into the 4.x branch. Discussion ---------- Allow use of ux-icons in form fields This allows to already start using UX Icons in form fields when passing the icon in the `icon-set:icon-name` format. Commits ------- c514559 Allow use of ux-icons in form fields
2 parents 605c7e4 + c514559 commit 29f2267

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/Field/FormField.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ private function fixIconFormat(?string $icon, string $methodName): ?string
183183
if (null === $icon) {
184184
return $icon;
185185
}
186-
if (!str_contains($icon, 'fa-') && !str_contains($icon, 'far-') && !str_contains($icon, 'fab-')) {
186+
if (!str_contains($icon, ':') && !str_contains($icon, 'fa-') && !str_contains($icon, 'far-') && !str_contains($icon, 'fab-')) {
187187
trigger_deprecation('easycorp/easyadmin-bundle', '4.4.0', 'The value passed as the $icon argument in "%s" method must be the full FontAwesome CSS class of the icon. For example, if you passed "user" before, you now must pass "fa fa-user" (or any style variant like "fa fa-solid fa-user").', $methodName);
188188
$icon = sprintf('fa fa-%s', $icon);
189189
}

0 commit comments

Comments
 (0)