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

Add custom icon to FormButton element #12

Merged
merged 1 commit into from
Feb 9, 2019
Merged

Add custom icon to FormButton element #12

merged 1 commit into from
Feb 9, 2019

Conversation

syberon
Copy link

@syberon syberon commented Feb 8, 2019

Since in this module removed 'fontAwesome' and 'glyphicon' view helpers
there are problem with icon assigning to buttons appeared.

In this commit i added a support to assign an icon to FormButton element
via direct tag providing in element config.

Supported 2 variants:

  1. By providing a scalar value containing tag
'element' => [
    'name' => 'button',
    'type' => Button::class,
    'options' => [
        'label'	=>'button',
	'icon' 	=> '<i class="fas fa-cogs"></i>'
    ]
]
  1. By providing an array:
'element' => [
    'name' => 'button',
    'type' => Button::class,
    'options' => [
        'label' => 'button',
	'icon'  => [
	    'icon'     => '<i class="fas-fa-cogs"></i>',
	    'position' => 'prepend'
	]
    ]
]

Since in this module removed 'fontAwesome' and 'glyphicon' view helpers
there are problem with icon assigning to buttons appeared.

In this commit i added a support to assign an icon to FormButton element
via direct tag providing in element config.

Supported 2 variants:

1. By providing a scalar value containing tag
'element' => [
    'name' => 'button',
    'type' => Button::class,
    'options' => [
        'label'	=>'button',
	'icon' 	=> '<i class="fas fa-cogs"></i>'
    ]
]

2. By providing an array:
'element' => [
    'name' => 'button',
    'type' => Button::class,
    'options' => [
        'label' => 'button',
	'icon'  => [
	    'icon'     => '<i class="fas-fa-cogs"></i>',
	    'position' => 'prepend'
	]
    ]
]
@neilime neilime merged commit 18cf759 into neilime:master Feb 9, 2019
@neilime
Copy link
Owner

neilime commented Feb 9, 2019

Thank you for this PR

@syberon syberon deleted the fix-button-icons branch February 10, 2019 02:59
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

Successfully merging this pull request may close these issues.

2 participants