/** * Get all icon constants for dropdown list in example * @param bool $html whether to render icon as array value prefix * @return array */ public static function getConstants($html = false) { $arr = []; foreach ((new \ReflectionClass(get_class()))->getConstants() as $constant) { $arr[static::$cssPrefix . ' ' . static::$cssPrefix . '-' . $constant] = $html ? FA::icon($constant) . ' ' . $constant : $constant; } return $arr; }
function icon($icon) { return FA::icon($icon); }
echo "</span>"; }); Html::macro('toggle', function ($active) { if ($active) { echo "<span style='color:green'>" . FA::icon('toggle-on')->x2(); } else { echo "<span style='color:gray'>" . FA::icon('toggle-off')->x2(); } echo "</span>"; }); Html::macro('featured', function ($active) { echo "<span style='color:black'>"; if ($active) { echo FA::icon('star'); } else { echo FA::icon('star-o'); } echo "</span>"; }); Html::macro('loadingImage', function () { echo "<span class='loadingImage'>"; echo FA::spin('circle-o-notch'); echo "</span>"; }); Html::macro('saveButton', function ($text = null) { echo "<button type=\"submit\" class=\"button\" onclick=\"\$(this).css('width','+=15');\">"; echo Html::loadingImage() . " "; if ($text == null) { echo Trans('admin.save'); } else { echo $text;