PHP code example of bugo / fa-php-helper

1. Go to this page and download the library: Download bugo/fa-php-helper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bugo / fa-php-helper example snippets




use Bugo\FontAwesome\Enums\Icon;

// 'fa-solid fa-user'
echo Icon::V6->solid('user');

// 'fa-regular fa-user'
echo Icon::V6->regular('user');

// 'fa-brands fa-windows'
echo Icon::V6->brand('windows');



use Bugo\FontAwesome\Enums\Icon;

$icon = Icon::V5->brand('windows');

// 'fab fa-windows fa-fw text-red-500'
var_dump(
    $icon
        ->fixedWidth()
        ->color('text-red-500')
        ->text()
);

$icon = Icon::V6->solid('user');

// '<i class="fa-solid fa-user fa-2xl" style="color:red" title="Пользователь" aria-hidden="true"></i>'
var_dump(
    $icon
        ->color('red')
        ->size('2xl')
        ->title('Пользователь')
        ->ariaHidden()
        ->html()
);



use Bugo\FontAwesome\Enums\Icon;

$icon = Icon::V6->solid('heart');

// '<i class="fa-solid fa-heart fa-beat"></i>'
var_dump(
    $icon
        ->addClass('fa-beat')
        ->html()
);



use Bugo\FontAwesome\Enums\Icon;

var_dump(Icon::V6->random());



use Bugo\FontAwesome\Enums\Icon;

var_dump(Icon::V6->collection());
bash
composer