Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I display icon on actions > buttons? #39

Closed
bfontanet opened this issue Aug 6, 2021 · 4 comments
Closed

Can I display icon on actions > buttons? #39

bfontanet opened this issue Aug 6, 2021 · 4 comments

Comments

@bfontanet
Copy link

I'd like display icon on action's buttons.
You have "caption" method but don't read HTML (to use fontawesome, for example).
Are any options for it?
Thanks!

2021-08-06_6-51-41
2021-08-06_6-51-04

@bfontanet
Copy link
Author

Sorry, I can see "i" method on Button class, but I cannot get how to watch the icon.
I have this code:

Button::add('synonyms')
  ->caption(__('Obtener sinónimos'))
  ->i('fas fa-cogs', __('Obtener sinónimos'), true)
  ->class('bg-purple-700 hover:bg-purple-900 text-white py-2 px-4 text-sm')
  ->route('entity.get-synonyms', ['entity' => 'id']),

I tried to get off "caption()" but don't work for me.
Can you help me?
2021-08-06_7-10-37

@luanfreitasdev
Copy link
Collaborator

Hello! @bfontanet ,

This method has been removed in this version and this weekend I will be releasing a new version where it will be possible to fix this problem. You can call it this way:

Button::add('synonyms')
  ->caption('<i class="fa-solid fa-info"></i>  '.__('Obtener sinónimos'))
  ->class('bg-purple-700 hover:bg-purple-900 text-white py-2 px-4 text-sm')
  ->route('entity.get-synonyms', ['entity' => 'id']),

@luanfreitasdev
Copy link
Collaborator

added into v1.2

@bfontanet
Copy link
Author

bfontanet commented Aug 9, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants