PHP code example of snowpurple / yii2-feathericons

1. Go to this page and download the library: Download snowpurple/yii2-feathericons 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/ */

    

snowpurple / yii2-feathericons example snippets




namespace app\assets;

use yii\web\AssetBundle;

class FeatherIconsAsset extends AssetBundle
{
    public $depends = [
        'basepodapps\feathericons\FeatherIconsAsset'
    ];
}

use app\assets\AppAsset;
use basepodapps\feathericons\FeatherIconsAsset;

AppAsset::register($this);
FeatherIconsAsset::register($this);

use kartik\icons\Icon;
Icon::map($this);

// Add 'Feather Icons' as custom icon framework
Icon::addFramework('feather', [
    'class' => '\basepodapps\feathericons\FeatherIconsAsset',
    'prefix' => 'feather-icon-',
]);
Icon::map($this, 'feather');

---

// Sample usage
<?= Icon::show('users', [
    'class'=>'page-header-icon',
    'data-feather' => 'users',
    'framework' => 'feather'
])