PHP code example of rmrevin / yii2-ionicon

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

    

rmrevin / yii2-ionicon example snippets


<?
// ...

rmrevin\yii\ionicon\AssetBundle::register($this);


<?
// ...

class AppAsset extends AssetBundle
{
	// ...

	public $depends = [
		// ...
		'\rmrevin\yii\ionicon\AssetBundle'
	];
}



use rmrevin\yii\ionicon\Ion;

echo Ion::icon('social-twitter');
// <i class="ion-social-twitter"></i>
echo Ion::icon('social-twitter', ['class' => 'big', 'data-role' => 'social-button']);
// <i class="big ion-social-twitter" data-role="social-button"></i>
echo Html::submitButton(Yii::t('app', '{check} Tweet', ['check' => Ion::icon('social-twitter')]));
// <button type="submit"><i class="ion-social-twitter"></i> Tweet</button>

// autocomplete in IDE
echo Ion::icon(Ion::_SOCIAL_TWITTER);
echo Ion::icon(Ion::_ANDROID_BULB);

Ion::$cssPrefix = 'ionicon';

echo Ion::icon('social-twitter');
// <i class="ionicon-social-twitter"></i>