rmrevin/yii2-ionicon

Asset Bundle for Yii2 with Ionicon

Installs: 58 626

Dependents: 3

Suggesters: 0

Security: 0

Stars: 7

Watchers: 3

Forks: 3

Open Issues: 1

Language:CSS

Type:yii2-extension

1.2.0 2016-05-22 20:07 UTC

This package is not auto-updated.

Last update: 2024-11-07 00:50:34 UTC


README

License Latest Stable Version Latest Unstable Version Total Downloads

Code Status

Scrutinizer Code Quality Code Coverage Travis CI Build Status Dependency Status

Installation

Either run

composer require "rmrevin/yii2-ionicon:~1.2"

or add in composer.json:

{
    "require": {
        "rmrevin/yii2-ionicon": "~1.2"
    }
}

Usage

In view

<?
// ...

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

or as dependency in your asset bundle

<?
// ...

class AppAsset extends AssetBundle
{
	// ...

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

Helper

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);

Another prefix

Ion::$cssPrefix = 'ionicon';

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