Skip to content

Commit

Permalink
add space option
Browse files Browse the repository at this point in the history
  • Loading branch information
cuileon committed May 29, 2018
1 parent b8ee2cd commit cc1f8a3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@
*/
class Icon
{
public static function show($name, $options = [])
public static function show($name, $options = [], $space = true)
{
return static::fas($name, $options);
return static::fas($name, $options, $space);
}

public static function fas($name, $options = [])
public static function fas($name, $options = [], $space = true)
{
FontAwesomeAsset::register(\Yii::$app->getView());
Html::addCssClass($options, ['type' =>'fas', 'name' => 'fa-' . $name]);
return Html::tag('i', null, $options) . ' ';
return Html::tag('i', null, $options) . ($space ? ' ' : null);
}

public static function far($name, $options = [])
public static function far($name, $options = [], $space = true)
{
FontAwesomeAsset::register(\Yii::$app->getView());
Html::addCssClass($options, ['type' =>'far', 'name' => 'fa-' . $name]);
return Html::tag('i', null, $options) . ' ';
return Html::tag('i', null, $options) . ($space ? ' ' : null);
}

public static function fal($name, $options = [])
public static function fal($name, $options = [], $space = true)
{
return new FontAwesome('fal', $name, $options) . ' ';
return new FontAwesome('fal', $name, $options) . ($space ? ' ' : null);
}

public static function fab($name, $options = [])
public static function fab($name, $options = [], $space = true)
{
FontAwesomeAsset::register(\Yii::$app->getView());
Html::addCssClass($options, ['type' =>'fab', 'name' => 'fa-' . $name]);
return Html::tag('i', null, $options) . ' ';
return Html::tag('i', null, $options) . ($space ? ' ' : null);
}
}

0 comments on commit cc1f8a3

Please sign in to comment.