PHP code example of digbang / font-awesome

1. Go to this page and download the library: Download digbang/font-awesome 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/ */

    

digbang / font-awesome example snippets


'providers' => [
    // ...
    Digbang\FontAwesome\FontAwesomeServiceProvider::class,
    
],

'aliases' => [
    // ...
    'FontAwesome' => Digbang\FontAwesome\Facade::class,
],

FontAwesome::icon('icon', 'extra-class') // <i class="fa fa-icon extra-class"></i>
// or...
FontAwesome::icon('icon', ['class' => 'extra-class']) // <i class="fa fa-icon extra-class"></i>

fa('icon', 'extra-class') // <i class="fa fa-icon extra-class"></i>
// or...
fa('icon', ['class' => 'extra-class']) // <i class="fa fa-icon extra-class"></i>

fa('times', ['title' => 'Delete this!']) // <i class="fa fa-times" title="Delete this!"></i>

FontAwesome::setTag('span');

fa('edit'); // <span class="fa fa-edit"></span>

$fa = new Digbang\FontAwesome\FontAwesome;
$fa->setTag('span');
$fa->icon('times', 'text-danger'); // <span class="fa fa-times text-danger"></span>