Class thoulah\fontawesome\Icon

Inheritancethoulah\fontawesome\Icon

Provides a quick and easy way to access icons.

$icon = new \thoulah\fontawesome\Icon();
echo $icon->show('at');
echo $icon->show('github', ['style' => 'brands', 'fill' => '#003865']);
echo $icon->show('font-awesome', ['class' => 'yourClass', 'style' => 'brands']);

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$defaults \thoulah\fontawesome\config\Defaults Default settings thoulah\fontawesome\Icon

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Creates a new Icon object. thoulah\fontawesome\Icon
activeFieldAddon() Returns the ActiveField inputTemplate. thoulah\fontawesome\Icon
activeFieldIcon() Returns the ActiveField Icon. thoulah\fontawesome\Icon
show() Outputs the SVG string. thoulah\fontawesome\Icon

Property Details

$defaults public property

Default settings

public \thoulah\fontawesome\config\Defaults $defaults null

Method Details

__construct() public method

Creates a new Icon object.

public void __construct ( array $config = [] )
$config array|null

Configuration of the icon

activeFieldAddon() public method

Returns the ActiveField inputTemplate.

public string activeFieldAddon ( \thoulah\fontawesome\string $name, array $options = [] )
$name string

Name of the icon

$options array|null

Options for the field and the icon

return string

ActiveField addon with icon and proper code

activeFieldIcon() public method

Returns the ActiveField Icon.

public string activeFieldIcon ( \thoulah\fontawesome\string $name, array $options = [] )
$name string

Name of the icon

$options array|null

Options for the field and the icon

return string

ActiveField icon with proper code

show() public method

Outputs the SVG string.

public string show ( \thoulah\fontawesome\string $name, array $options = [] )
$name string

Name of the icon, or filename

$options array|null

Options for the icon

return string

The icon