This commit is contained in:
2020-10-06 14:27:47 +07:00
commit 586be80cf6
16613 changed files with 3274099 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
/.idea
/vendor
/coverage

View File

@@ -0,0 +1,28 @@
build:
environment:
php:
version: 5.5.12
dependencies:
before:
- composer global require "fxp/composer-asset-plugin:~1.1"
tests:
override:
- phpunit
imports:
- php
checks:
php:
code_rating: true
duplication: true
tools:
php_sim: false
php_cpd: false
php_pdepend: true
php_analyzer: true
php_changetracking: true
external_code_coverage:
timeout: 2100 # Timeout in seconds.
filter:
excluded_paths:
- tests/*
- vendor/*

View File

@@ -0,0 +1,32 @@
language: php
php:
- 5.5
- 5.6
- hhvm
- hhvm-nightly
matrix:
fast_finish: true
allow_failures:
- php: hhvm
- php: hhvm-nightly
sudo: false
cache:
directories:
- vendor
install:
- travis_retry composer self-update && composer --version
- travis_retry composer global require "fxp/composer-asset-plugin:~1.1"
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- travis_retry composer install --prefer-dist --no-interaction
script:
- phpunit --verbose --coverage-clover=coverage/coverage.clover
after_script:
- travis_retry wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage/coverage.clover

View File

@@ -0,0 +1,42 @@
<?php
/**
* AssetBundle.php
* @author Revin Roman
* @link https://rmrevin.ru
*/
namespace rmrevin\yii\fontawesome;
/**
* Class AssetBundle
* @package rmrevin\yii\fontawesome
*/
class AssetBundle extends \yii\web\AssetBundle
{
/**
* @inherit
*/
public $sourcePath = '@vendor/fortawesome/font-awesome';
/**
* @inherit
*/
public $css = [
'css/font-awesome.min.css',
];
/**
* Initializes the bundle.
* Set publish options to copy only necessary files (in this case css and font folders)
* @codeCoverageIgnore
*/
public function init()
{
parent::init();
$this->publishOptions['beforeCopy'] = function ($from, $to) {
return preg_match('%(/|\\\\)(fonts|css)%', $from);
};
}
}

View File

@@ -0,0 +1,147 @@
2017-01-11 - 2.17.1
-------------------
* Downgrade minimum php to `5.4`
2016-10-25 - 2.17.0
-------------------
* `Font Awesome` updated to version `4.7`.
* Update minimum php to `5.5`
* These deprecated classes are now removed:
* `rmrevin\yii\fontawesome\CDNAssetBundle`
* These deprecated methods are now removed:
* `rmrevin\yii\fontawesome\component\Icon::ul`
* `rmrevin\yii\fontawesome\component\Icon::fixed_width`
* `rmrevin\yii\fontawesome\component\Icon::pull_left`
* `rmrevin\yii\fontawesome\component\Icon::pull_right`
* In method `rmrevin\yii\fontawesome\component\UnorderedList::item` changed interface (removed `$icon` param).
* These directories are now deprecated:
* `./assets`
* These fields and methods are now deprecated:
* `rmrevin\yii\fontawesome\component\Icon::$defaultTag`
* `rmrevin\yii\fontawesome\component\Icon::$tag`
* `rmrevin\yii\fontawesome\component\Icon::tag()`
* `rmrevin\yii\fontawesome\component\Icon::render()`
* `rmrevin\yii\fontawesome\component\Stack::$defaultTag`
* `rmrevin\yii\fontawesome\component\Stack::$tag`
* `rmrevin\yii\fontawesome\component\Stack::tag()`
* `rmrevin\yii\fontawesome\component\Stack::render()`
* `rmrevin\yii\fontawesome\component\UnorderedList::$defaultTag`
* `rmrevin\yii\fontawesome\component\UnorderedList::$tag`
* `rmrevin\yii\fontawesome\component\UnorderedList::tag()`
* `rmrevin\yii\fontawesome\component\UnorderedList::render()`
* Refactoring class `rmrevin\yii\fontawesome\component\UnorderedList`.
2016-08-31 - 2.16.1
-------------------
* Fix options in li item.
* Update readme.
2016-08-31 - 2.16.0
-------------------
* Enh #22: Added FA:ul() method.
* Refactoring.
2016-08-19 - 2.15.2
-------------------
* Update icon name constants to version 4.6.3.
2016-05-29 - 2.15.1
-------------------
* Added option to skip the icon.
* Added option to change the order of icons in the stack.
2016-05-22 - 2.15.0
-------------------
* Remove bower package.
2016-04-16 - 2.14.0
-------------------
* `Font Awesome` updated to version `4.6`.
2015-11-26 - 2.13.0
-------------------
* `Font Awesome` updated to version `4.5`.
2015-11-20 - 2.12.2
-------------------
* Add shortcuts methods `i()` for `FA::icon()` and `FA::s()` for `FA::stack()`
* Update readme
2015-11-09 - 2.12.1
-------------------
* Variable `FA::$cssPrefix` transferred to the class `FontAwesome`.
* Refactoring.
* Update tests.
2015-08-15 - 2.12.0
-------------------
* `Font Awesome` updated to version `4.4`.
2015-06-29 - 2.11.0
-------------------
* Added the ability to change the tag for icons.
2015-06-23 - 2.10.3
-------------------
* Change `cnd` url to cloudflare.
2015-06-19 - 2.10.2
-------------------
* `CDNAssetBundle` is now deprecated. Use `rmrevin\yii\fontawesome\cdn\AssetBundle`.
* Refactoring.
2015-05-09 - 2.10.1
-------------------
* Fix bug in tests.
2015-05-09 - 2.10.0
-------------------
* Add CDN asset bundle `CDNAssetBundle`.
* Composer package `fortawesome/font-awesome` replaced on bower package `bower-asset/fontawesome`.
* Adding warning messages in deprecated methods.
* Add changelog.
* Refactoring.
* Update readme.
2015-04-28 - 2.9.2
------------------
* Method `icon()->fixed_width()` is deprecated. Use instead `icon()->fixedWidth()`.
* Method `icon()->pull_left()` is deprecated. Use instead `icon()->pullLeft()`.
* Method `icon()->pull_right()` is deprecated. Use instead `icon()->pullRight()`.
* Updated tests.
2015-04-08 - 2.9.1
------------------
* Fix asset bundle publish bug on windows.
2015-03-31 - 2.9.0
------------------
* In asset bundle added `init` method for filtering publising assets.
2015-03-17 - 2.8.2
------------------
* Refactoring.
2015-03-16 - 2.8.1
------------------
* Update readme.
2015-03-16 - 2.8.0
------------------
* In class `FA` add static property `cssPrefix` for customizing css class.
* Refactoring.
* Update readme.
2015-02-08 - 2.7.1
------------------
* Update travisCI config.
2015-01-26 - 2.7.0
------------------
* `Font Awesome` updated to version `4.3`.
* Update icons constants list.
* Update readme.
Until 2015-03-04
----------------
* Implementation of extension.

833
vendor/rmrevin/yii2-fontawesome/FA.php vendored Normal file
View File

@@ -0,0 +1,833 @@
<?php
/**
* FA.php
* @author Revin Roman
* @link https://rmrevin.ru
*/
namespace rmrevin\yii\fontawesome;
/**
* Class FA
* @package rmrevin\yii\fontawesome
*/
class FA extends FontAwesome
{
/**
* Get all icon constants for dropdown list in example
* @param bool $html whether to render icon as array value prefix
* @return array
*/
public static function getConstants($html = false)
{
$result = [];
foreach ((new \ReflectionClass(get_class()))->getConstants() as $constant) {
$key = static::$cssPrefix . ' ' . static::$cssPrefix . '-' . $constant;
$result[$key] = ($html)
? static::icon($constant) . '&nbsp;&nbsp;' . $constant
: $constant;
}
return $result;
}
/**
* How I saved from: http://fortawesome.github.io/Font-Awesome/cheatsheet/
*
* $.each($('.col-md-4.col-sm-6.col-lg-3').text().split(' '), function (i, item) {
* if(item.indexOf('fa-') !== -1) {
* var icon = item.substr(3).replace(/(\n)/g, '');
* console.log('const _' + icon.replace(/-/gi, '_').toUpperCase() + " = '" + icon + "';")
* }
* });
*/
const _500PX = '500px';
const _ADDRESS_BOOK = 'address-book';
const _ADDRESS_BOOK_O = 'address-book-o';
const _ADDRESS_CARD = 'address-card';
const _ADDRESS_CARD_O = 'address-card-o';
const _ADJUST = 'adjust';
const _ADN = 'adn';
const _ALIGN_CENTER = 'align-center';
const _ALIGN_JUSTIFY = 'align-justify';
const _ALIGN_LEFT = 'align-left';
const _ALIGN_RIGHT = 'align-right';
const _AMAZON = 'amazon';
const _AMBULANCE = 'ambulance';
const _AMERICAN_SIGN_LANGUAGE_INTERPRETING = 'american-sign-language-interpreting';
const _ANCHOR = 'anchor';
const _ANDROID = 'android';
const _ANGELLIST = 'angellist';
const _ANGLE_DOUBLE_DOWN = 'angle-double-down';
const _ANGLE_DOUBLE_LEFT = 'angle-double-left';
const _ANGLE_DOUBLE_RIGHT = 'angle-double-right';
const _ANGLE_DOUBLE_UP = 'angle-double-up';
const _ANGLE_DOWN = 'angle-down';
const _ANGLE_LEFT = 'angle-left';
const _ANGLE_RIGHT = 'angle-right';
const _ANGLE_UP = 'angle-up';
const _APPLE = 'apple';
const _ARCHIVE = 'archive';
const _AREA_CHART = 'area-chart';
const _ARROW_CIRCLE_DOWN = 'arrow-circle-down';
const _ARROW_CIRCLE_LEFT = 'arrow-circle-left';
const _ARROW_CIRCLE_O_DOWN = 'arrow-circle-o-down';
const _ARROW_CIRCLE_O_LEFT = 'arrow-circle-o-left';
const _ARROW_CIRCLE_O_RIGHT = 'arrow-circle-o-right';
const _ARROW_CIRCLE_O_UP = 'arrow-circle-o-up';
const _ARROW_CIRCLE_RIGHT = 'arrow-circle-right';
const _ARROW_CIRCLE_UP = 'arrow-circle-up';
const _ARROW_DOWN = 'arrow-down';
const _ARROW_LEFT = 'arrow-left';
const _ARROW_RIGHT = 'arrow-right';
const _ARROW_UP = 'arrow-up';
const _ARROWS = 'arrows';
const _ARROWS_ALT = 'arrows-alt';
const _ARROWS_H = 'arrows-h';
const _ARROWS_V = 'arrows-v';
const _ASL_INTERPRETING = 'asl-interpreting';
const _ASSISTIVE_LISTENING_SYSTEMS = 'assistive-listening-systems';
const _ASTERISK = 'asterisk';
const _AT = 'at';
const _AUDIO_DESCRIPTION = 'audio-description';
const _AUTOMOBILE = 'automobile';
const _BACKWARD = 'backward';
const _BALANCE_SCALE = 'balance-scale';
const _BAN = 'ban';
const _BANDCAMP = 'bandcamp';
const _BANK = 'bank';
const _BAR_CHART = 'bar-chart';
const _BAR_CHART_O = 'bar-chart-o';
const _BARCODE = 'barcode';
const _BARS = 'bars';
const _BATH = 'bath';
const _BATHTUB = 'bathtub';
const _BATTERY = 'battery';
const _BATTERY_0 = 'battery-0';
const _BATTERY_1 = 'battery-1';
const _BATTERY_2 = 'battery-2';
const _BATTERY_3 = 'battery-3';
const _BATTERY_4 = 'battery-4';
const _BATTERY_EMPTY = 'battery-empty';
const _BATTERY_FULL = 'battery-full';
const _BATTERY_HALF = 'battery-half';
const _BATTERY_QUARTER = 'battery-quarter';
const _BATTERY_THREE_QUARTERS = 'battery-three-quarters';
const _BED = 'bed';
const _BEER = 'beer';
const _BEHANCE = 'behance';
const _BEHANCE_SQUARE = 'behance-square';
const _BELL = 'bell';
const _BELL_O = 'bell-o';
const _BELL_SLASH = 'bell-slash';
const _BELL_SLASH_O = 'bell-slash-o';
const _BICYCLE = 'bicycle';
const _BINOCULARS = 'binoculars';
const _BIRTHDAY_CAKE = 'birthday-cake';
const _BITBUCKET = 'bitbucket';
const _BITBUCKET_SQUARE = 'bitbucket-square';
const _BITCOIN = 'bitcoin';
const _BLACK_TIE = 'black-tie';
const _BLIND = 'blind';
const _BLUETOOTH = 'bluetooth';
const _BLUETOOTH_B = 'bluetooth-b';
const _BOLD = 'bold';
const _BOLT = 'bolt';
const _BOMB = 'bomb';
const _BOOK = 'book';
const _BOOKMARK = 'bookmark';
const _BOOKMARK_O = 'bookmark-o';
const _BRAILLE = 'braille';
const _BRIEFCASE = 'briefcase';
const _BTC = 'btc';
const _BUG = 'bug';
const _BUILDING = 'building';
const _BUILDING_O = 'building-o';
const _BULLHORN = 'bullhorn';
const _BULLSEYE = 'bullseye';
const _BUS = 'bus';
const _BUYSELLADS = 'buysellads';
const _CAB = 'cab';
const _CALCULATOR = 'calculator';
const _CALENDAR = 'calendar';
const _CALENDAR_CHECK_O = 'calendar-check-o';
const _CALENDAR_MINUS_O = 'calendar-minus-o';
const _CALENDAR_O = 'calendar-o';
const _CALENDAR_PLUS_O = 'calendar-plus-o';
const _CALENDAR_TIMES_O = 'calendar-times-o';
const _CAMERA = 'camera';
const _CAMERA_RETRO = 'camera-retro';
const _CAR = 'car';
const _CARET_DOWN = 'caret-down';
const _CARET_LEFT = 'caret-left';
const _CARET_RIGHT = 'caret-right';
const _CARET_SQUARE_O_DOWN = 'caret-square-o-down';
const _CARET_SQUARE_O_LEFT = 'caret-square-o-left';
const _CARET_SQUARE_O_RIGHT = 'caret-square-o-right';
const _CARET_SQUARE_O_UP = 'caret-square-o-up';
const _CARET_UP = 'caret-up';
const _CART_ARROW_DOWN = 'cart-arrow-down';
const _CART_PLUS = 'cart-plus';
const _CC = 'cc';
const _CC_AMEX = 'cc-amex';
const _CC_DINERS_CLUB = 'cc-diners-club';
const _CC_DISCOVER = 'cc-discover';
const _CC_JCB = 'cc-jcb';
const _CC_MASTERCARD = 'cc-mastercard';
const _CC_PAYPAL = 'cc-paypal';
const _CC_STRIPE = 'cc-stripe';
const _CC_VISA = 'cc-visa';
const _CERTIFICATE = 'certificate';
const _CHAIN = 'chain';
const _CHAIN_BROKEN = 'chain-broken';
const _CHECK = 'check';
const _CHECK_CIRCLE = 'check-circle';
const _CHECK_CIRCLE_O = 'check-circle-o';
const _CHECK_SQUARE = 'check-square';
const _CHECK_SQUARE_O = 'check-square-o';
const _CHEVRON_CIRCLE_DOWN = 'chevron-circle-down';
const _CHEVRON_CIRCLE_LEFT = 'chevron-circle-left';
const _CHEVRON_CIRCLE_RIGHT = 'chevron-circle-right';
const _CHEVRON_CIRCLE_UP = 'chevron-circle-up';
const _CHEVRON_DOWN = 'chevron-down';
const _CHEVRON_LEFT = 'chevron-left';
const _CHEVRON_RIGHT = 'chevron-right';
const _CHEVRON_UP = 'chevron-up';
const _CHILD = 'child';
const _CHROME = 'chrome';
const _CIRCLE = 'circle';
const _CIRCLE_O = 'circle-o';
const _CIRCLE_O_NOTCH = 'circle-o-notch';
const _CIRCLE_THIN = 'circle-thin';
const _CLIPBOARD = 'clipboard';
const _CLOCK_O = 'clock-o';
const _CLONE = 'clone';
const _CLOSE = 'close';
const _CLOUD = 'cloud';
const _CLOUD_DOWNLOAD = 'cloud-download';
const _CLOUD_UPLOAD = 'cloud-upload';
const _CNY = 'cny';
const _CODE = 'code';
const _CODE_FORK = 'code-fork';
const _CODEPEN = 'codepen';
const _CODIEPIE = 'codiepie';
const _COFFEE = 'coffee';
const _COG = 'cog';
const _COGS = 'cogs';
const _COLUMNS = 'columns';
const _COMMENT = 'comment';
const _COMMENT_O = 'comment-o';
const _COMMENTING = 'commenting';
const _COMMENTING_O = 'commenting-o';
const _COMMENTS = 'comments';
const _COMMENTS_O = 'comments-o';
const _COMPASS = 'compass';
const _COMPRESS = 'compress';
const _CONNECTDEVELOP = 'connectdevelop';
const _CONTAO = 'contao';
const _COPY = 'copy';
const _COPYRIGHT = 'copyright';
const _CREATIVE_COMMONS = 'creative-commons';
const _CREDIT_CARD = 'credit-card';
const _CREDIT_CARD_ALT = 'credit-card-alt';
const _CROP = 'crop';
const _CROSSHAIRS = 'crosshairs';
const _CSS3 = 'css3';
const _CUBE = 'cube';
const _CUBES = 'cubes';
const _CUT = 'cut';
const _CUTLERY = 'cutlery';
const _DASHBOARD = 'dashboard';
const _DASHCUBE = 'dashcube';
const _DATABASE = 'database';
const _DEAF = 'deaf';
const _DEAFNESS = 'deafness';
const _DEDENT = 'dedent';
const _DELICIOUS = 'delicious';
const _DESKTOP = 'desktop';
const _DEVIANTART = 'deviantart';
const _DIAMOND = 'diamond';
const _DIGG = 'digg';
const _DOLLAR = 'dollar';
const _DOT_CIRCLE_O = 'dot-circle-o';
const _DOWNLOAD = 'download';
const _DRIBBBLE = 'dribbble';
const _DRIVERS_LICENSE = 'drivers-license';
const _DRIVERS_LICENSE_O = 'drivers-license-o';
const _DROPBOX = 'dropbox';
const _DRUPAL = 'drupal';
const _EDGE = 'edge';
const _EDIT = 'edit';
const _EERCAST = 'eercast';
const _EJECT = 'eject';
const _ELLIPSIS_H = 'ellipsis-h';
const _ELLIPSIS_V = 'ellipsis-v';
const _EMPIRE = 'empire';
const _ENVELOPE = 'envelope';
const _ENVELOPE_O = 'envelope-o';
const _ENVELOPE_OPEN = 'envelope-open';
const _ENVELOPE_OPEN_O = 'envelope-open-o';
const _ENVELOPE_SQUARE = 'envelope-square';
const _ENVIRA = 'envira';
const _ERASER = 'eraser';
const _ETSY = 'etsy';
const _EUR = 'eur';
const _EURO = 'euro';
const _EXCHANGE = 'exchange';
const _EXCLAMATION = 'exclamation';
const _EXCLAMATION_CIRCLE = 'exclamation-circle';
const _EXCLAMATION_TRIANGLE = 'exclamation-triangle';
const _EXPAND = 'expand';
const _EXPEDITEDSSL = 'expeditedssl';
const _EXTERNAL_LINK = 'external-link';
const _EXTERNAL_LINK_SQUARE = 'external-link-square';
const _EYE = 'eye';
const _EYE_SLASH = 'eye-slash';
const _EYEDROPPER = 'eyedropper';
const _FA = 'fa';
const _FACEBOOK = 'facebook';
const _FACEBOOK_F = 'facebook-f';
const _FACEBOOK_OFFICIAL = 'facebook-official';
const _FACEBOOK_SQUARE = 'facebook-square';
const _FAST_BACKWARD = 'fast-backward';
const _FAST_FORWARD = 'fast-forward';
const _FAX = 'fax';
const _FEED = 'feed';
const _FEMALE = 'female';
const _FIGHTER_JET = 'fighter-jet';
const _FILE = 'file';
const _FILE_ARCHIVE_O = 'file-archive-o';
const _FILE_AUDIO_O = 'file-audio-o';
const _FILE_CODE_O = 'file-code-o';
const _FILE_EXCEL_O = 'file-excel-o';
const _FILE_IMAGE_O = 'file-image-o';
const _FILE_MOVIE_O = 'file-movie-o';
const _FILE_O = 'file-o';
const _FILE_PDF_O = 'file-pdf-o';
const _FILE_PHOTO_O = 'file-photo-o';
const _FILE_PICTURE_O = 'file-picture-o';
const _FILE_POWERPOINT_O = 'file-powerpoint-o';
const _FILE_SOUND_O = 'file-sound-o';
const _FILE_TEXT = 'file-text';
const _FILE_TEXT_O = 'file-text-o';
const _FILE_VIDEO_O = 'file-video-o';
const _FILE_WORD_O = 'file-word-o';
const _FILE_ZIP_O = 'file-zip-o';
const _FILES_O = 'files-o';
const _FILM = 'film';
const _FILTER = 'filter';
const _FIRE = 'fire';
const _FIRE_EXTINGUISHER = 'fire-extinguisher';
const _FIREFOX = 'firefox';
const _FIRST_ORDER = 'first-order';
const _FLAG = 'flag';
const _FLAG_CHECKERED = 'flag-checkered';
const _FLAG_O = 'flag-o';
const _FLASH = 'flash';
const _FLASK = 'flask';
const _FLICKR = 'flickr';
const _FLOPPY_O = 'floppy-o';
const _FOLDER = 'folder';
const _FOLDER_O = 'folder-o';
const _FOLDER_OPEN = 'folder-open';
const _FOLDER_OPEN_O = 'folder-open-o';
const _FONT = 'font';
const _FONT_AWESOME = 'font-awesome';
const _FONTICONS = 'fonticons';
const _FORT_AWESOME = 'fort-awesome';
const _FORUMBEE = 'forumbee';
const _FORWARD = 'forward';
const _FOURSQUARE = 'foursquare';
const _FREE_CODE_CAMP = 'free-code-camp';
const _FROWN_O = 'frown-o';
const _FUTBOL_O = 'futbol-o';
const _GAMEPAD = 'gamepad';
const _GAVEL = 'gavel';
const _GBP = 'gbp';
const _GE = 'ge';
const _GEAR = 'gear';
const _GEARS = 'gears';
const _GENDERLESS = 'genderless';
const _GET_POCKET = 'get-pocket';
const _GG = 'gg';
const _GG_CIRCLE = 'gg-circle';
const _GIFT = 'gift';
const _GIT = 'git';
const _GIT_SQUARE = 'git-square';
const _GITHUB = 'github';
const _GITHUB_ALT = 'github-alt';
const _GITHUB_SQUARE = 'github-square';
const _GITLAB = 'gitlab';
const _GITTIP = 'gittip';
const _GLASS = 'glass';
const _GLIDE = 'glide';
const _GLIDE_G = 'glide-g';
const _GLOBE = 'globe';
const _GOOGLE = 'google';
const _GOOGLE_PLUS = 'google-plus';
const _GOOGLE_PLUS_CIRCLE = 'google-plus-circle';
const _GOOGLE_PLUS_OFFICIAL = 'google-plus-official';
const _GOOGLE_PLUS_SQUARE = 'google-plus-square';
const _GOOGLE_WALLET = 'google-wallet';
const _GRADUATION_CAP = 'graduation-cap';
const _GRATIPAY = 'gratipay';
const _GRAV = 'grav';
const _GROUP = 'group';
const _H_SQUARE = 'h-square';
const _HACKER_NEWS = 'hacker-news';
const _HAND_GRAB_O = 'hand-grab-o';
const _HAND_LIZARD_O = 'hand-lizard-o';
const _HAND_O_DOWN = 'hand-o-down';
const _HAND_O_LEFT = 'hand-o-left';
const _HAND_O_RIGHT = 'hand-o-right';
const _HAND_O_UP = 'hand-o-up';
const _HAND_PAPER_O = 'hand-paper-o';
const _HAND_PEACE_O = 'hand-peace-o';
const _HAND_POINTER_O = 'hand-pointer-o';
const _HAND_ROCK_O = 'hand-rock-o';
const _HAND_SCISSORS_O = 'hand-scissors-o';
const _HAND_SPOCK_O = 'hand-spock-o';
const _HAND_STOP_O = 'hand-stop-o';
const _HANDSHAKE_O = 'handshake-o';
const _HARD_OF_HEARING = 'hard-of-hearing';
const _HASHTAG = 'hashtag';
const _HDD_O = 'hdd-o';
const _HEADER = 'header';
const _HEADPHONES = 'headphones';
const _HEART = 'heart';
const _HEART_O = 'heart-o';
const _HEARTBEAT = 'heartbeat';
const _HISTORY = 'history';
const _HOME = 'home';
const _HOSPITAL_O = 'hospital-o';
const _HOTEL = 'hotel';
const _HOURGLASS = 'hourglass';
const _HOURGLASS_1 = 'hourglass-1';
const _HOURGLASS_2 = 'hourglass-2';
const _HOURGLASS_3 = 'hourglass-3';
const _HOURGLASS_END = 'hourglass-end';
const _HOURGLASS_HALF = 'hourglass-half';
const _HOURGLASS_O = 'hourglass-o';
const _HOURGLASS_START = 'hourglass-start';
const _HOUZZ = 'houzz';
const _HTML5 = 'html5';
const _I_CURSOR = 'i-cursor';
const _ID_BADGE = 'id-badge';
const _ID_CARD = 'id-card';
const _ID_CARD_O = 'id-card-o';
const _ILS = 'ils';
const _IMAGE = 'image';
const _IMDB = 'imdb';
const _INBOX = 'inbox';
const _INDENT = 'indent';
const _INDUSTRY = 'industry';
const _INFO = 'info';
const _INFO_CIRCLE = 'info-circle';
const _INR = 'inr';
const _INSTAGRAM = 'instagram';
const _INSTITUTION = 'institution';
const _INTERNET_EXPLORER = 'internet-explorer';
const _INTERSEX = 'intersex';
const _IOXHOST = 'ioxhost';
const _ITALIC = 'italic';
const _JOOMLA = 'joomla';
const _JPY = 'jpy';
const _JSFIDDLE = 'jsfiddle';
const _KEY = 'key';
const _KEYBOARD_O = 'keyboard-o';
const _KRW = 'krw';
const _LANGUAGE = 'language';
const _LAPTOP = 'laptop';
const _LASTFM = 'lastfm';
const _LASTFM_SQUARE = 'lastfm-square';
const _LEAF = 'leaf';
const _LEANPUB = 'leanpub';
const _LEGAL = 'legal';
const _LEMON_O = 'lemon-o';
const _LEVEL_DOWN = 'level-down';
const _LEVEL_UP = 'level-up';
const _LIFE_BOUY = 'life-bouy';
const _LIFE_BUOY = 'life-buoy';
const _LIFE_RING = 'life-ring';
const _LIFE_SAVER = 'life-saver';
const _LIGHTBULB_O = 'lightbulb-o';
const _LINE_CHART = 'line-chart';
const _LINK = 'link';
const _LINKEDIN = 'linkedin';
const _LINKEDIN_SQUARE = 'linkedin-square';
const _LINODE = 'linode';
const _LINUX = 'linux';
const _LIST = 'list';
const _LIST_ALT = 'list-alt';
const _LIST_OL = 'list-ol';
const _LIST_UL = 'list-ul';
const _LOCATION_ARROW = 'location-arrow';
const _LOCK = 'lock';
const _LONG_ARROW_DOWN = 'long-arrow-down';
const _LONG_ARROW_LEFT = 'long-arrow-left';
const _LONG_ARROW_RIGHT = 'long-arrow-right';
const _LONG_ARROW_UP = 'long-arrow-up';
const _LOW_VISION = 'low-vision';
const _MAGIC = 'magic';
const _MAGNET = 'magnet';
const _MAIL_FORWARD = 'mail-forward';
const _MAIL_REPLY = 'mail-reply';
const _MAIL_REPLY_ALL = 'mail-reply-all';
const _MALE = 'male';
const _MAP = 'map';
const _MAP_MARKER = 'map-marker';
const _MAP_O = 'map-o';
const _MAP_PIN = 'map-pin';
const _MAP_SIGNS = 'map-signs';
const _MARS = 'mars';
const _MARS_DOUBLE = 'mars-double';
const _MARS_STROKE = 'mars-stroke';
const _MARS_STROKE_H = 'mars-stroke-h';
const _MARS_STROKE_V = 'mars-stroke-v';
const _MAXCDN = 'maxcdn';
const _MEANPATH = 'meanpath';
const _MEDIUM = 'medium';
const _MEDKIT = 'medkit';
const _MEETUP = 'meetup';
const _MEH_O = 'meh-o';
const _MERCURY = 'mercury';
const _MICROCHIP = 'microchip';
const _MICROPHONE = 'microphone';
const _MICROPHONE_SLASH = 'microphone-slash';
const _MINUS = 'minus';
const _MINUS_CIRCLE = 'minus-circle';
const _MINUS_SQUARE = 'minus-square';
const _MINUS_SQUARE_O = 'minus-square-o';
const _MIXCLOUD = 'mixcloud';
const _MOBILE = 'mobile';
const _MOBILE_PHONE = 'mobile-phone';
const _MODX = 'modx';
const _MONEY = 'money';
const _MOON_O = 'moon-o';
const _MORTAR_BOARD = 'mortar-board';
const _MOTORCYCLE = 'motorcycle';
const _MOUSE_POINTER = 'mouse-pointer';
const _MUSIC = 'music';
const _NAVICON = 'navicon';
const _NEUTER = 'neuter';
const _NEWSPAPER_O = 'newspaper-o';
const _OBJECT_GROUP = 'object-group';
const _OBJECT_UNGROUP = 'object-ungroup';
const _ODNOKLASSNIKI = 'odnoklassniki';
const _ODNOKLASSNIKI_SQUARE = 'odnoklassniki-square';
const _OPENCART = 'opencart';
const _OPENID = 'openid';
const _OPERA = 'opera';
const _OPTIN_MONSTER = 'optin-monster';
const _OUTDENT = 'outdent';
const _PAGELINES = 'pagelines';
const _PAINT_BRUSH = 'paint-brush';
const _PAPER_PLANE = 'paper-plane';
const _PAPER_PLANE_O = 'paper-plane-o';
const _PAPERCLIP = 'paperclip';
const _PARAGRAPH = 'paragraph';
const _PASTE = 'paste';
const _PAUSE = 'pause';
const _PAUSE_CIRCLE = 'pause-circle';
const _PAUSE_CIRCLE_O = 'pause-circle-o';
const _PAW = 'paw';
const _PAYPAL = 'paypal';
const _PENCIL = 'pencil';
const _PENCIL_SQUARE = 'pencil-square';
const _PENCIL_SQUARE_O = 'pencil-square-o';
const _PERCENT = 'percent';
const _PHONE = 'phone';
const _PHONE_SQUARE = 'phone-square';
const _PHOTO = 'photo';
const _PICTURE_O = 'picture-o';
const _PIE_CHART = 'pie-chart';
const _PIED_PIPER = 'pied-piper';
const _PIED_PIPER_ALT = 'pied-piper-alt';
const _PIED_PIPER_PP = 'pied-piper-pp';
const _PINTEREST = 'pinterest';
const _PINTEREST_P = 'pinterest-p';
const _PINTEREST_SQUARE = 'pinterest-square';
const _PLANE = 'plane';
const _PLAY = 'play';
const _PLAY_CIRCLE = 'play-circle';
const _PLAY_CIRCLE_O = 'play-circle-o';
const _PLUG = 'plug';
const _PLUS = 'plus';
const _PLUS_CIRCLE = 'plus-circle';
const _PLUS_SQUARE = 'plus-square';
const _PLUS_SQUARE_O = 'plus-square-o';
const _PODCAST = 'podcast';
const _POWER_OFF = 'power-off';
const _PRINT = 'print';
const _PRODUCT_HUNT = 'product-hunt';
const _PUZZLE_PIECE = 'puzzle-piece';
const _QQ = 'qq';
const _QRCODE = 'qrcode';
const _QUESTION = 'question';
const _QUESTION_CIRCLE = 'question-circle';
const _QUESTION_CIRCLE_O = 'question-circle-o';
const _QUORA = 'quora';
const _QUOTE_LEFT = 'quote-left';
const _QUOTE_RIGHT = 'quote-right';
const _RA = 'ra';
const _RANDOM = 'random';
const _RAVELRY = 'ravelry';
const _REBEL = 'rebel';
const _RECYCLE = 'recycle';
const _REDDIT = 'reddit';
const _REDDIT_ALIEN = 'reddit-alien';
const _REDDIT_SQUARE = 'reddit-square';
const _REFRESH = 'refresh';
const _REGISTERED = 'registered';
const _REMOVE = 'remove';
const _RENREN = 'renren';
const _REORDER = 'reorder';
const _REPEAT = 'repeat';
const _REPLY = 'reply';
const _REPLY_ALL = 'reply-all';
const _RESISTANCE = 'resistance';
const _RETWEET = 'retweet';
const _RMB = 'rmb';
const _ROAD = 'road';
const _ROCKET = 'rocket';
const _ROTATE_LEFT = 'rotate-left';
const _ROTATE_RIGHT = 'rotate-right';
const _ROUBLE = 'rouble';
const _RSS = 'rss';
const _RSS_SQUARE = 'rss-square';
const _RUB = 'rub';
const _RUBLE = 'ruble';
const _RUPEE = 'rupee';
const _S15 = 's15';
const _SAFARI = 'safari';
const _SAVE = 'save';
const _SCISSORS = 'scissors';
const _SCRIBD = 'scribd';
const _SEARCH = 'search';
const _SEARCH_MINUS = 'search-minus';
const _SEARCH_PLUS = 'search-plus';
const _SELLSY = 'sellsy';
const _SEND = 'send';
const _SEND_O = 'send-o';
const _SERVER = 'server';
const _SHARE = 'share';
const _SHARE_ALT = 'share-alt';
const _SHARE_ALT_SQUARE = 'share-alt-square';
const _SHARE_SQUARE = 'share-square';
const _SHARE_SQUARE_O = 'share-square-o';
const _SHEKEL = 'shekel';
const _SHEQEL = 'sheqel';
const _SHIELD = 'shield';
const _SHIP = 'ship';
const _SHIRTSINBULK = 'shirtsinbulk';
const _SHOPPING_BAG = 'shopping-bag';
const _SHOPPING_BASKET = 'shopping-basket';
const _SHOPPING_CART = 'shopping-cart';
const _SHOWER = 'shower';
const _SIGN_IN = 'sign-in';
const _SIGN_LANGUAGE = 'sign-language';
const _SIGN_OUT = 'sign-out';
const _SIGNAL = 'signal';
const _SIGNING = 'signing';
const _SIMPLYBUILT = 'simplybuilt';
const _SITEMAP = 'sitemap';
const _SKYATLAS = 'skyatlas';
const _SKYPE = 'skype';
const _SLACK = 'slack';
const _SLIDERS = 'sliders';
const _SLIDESHARE = 'slideshare';
const _SMILE_O = 'smile-o';
const _SNAPCHAT = 'snapchat';
const _SNAPCHAT_GHOST = 'snapchat-ghost';
const _SNAPCHAT_SQUARE = 'snapchat-square';
const _SNOWFLAKE_O = 'snowflake-o';
const _SOCCER_BALL_O = 'soccer-ball-o';
const _SORT = 'sort';
const _SORT_ALPHA_ASC = 'sort-alpha-asc';
const _SORT_ALPHA_DESC = 'sort-alpha-desc';
const _SORT_AMOUNT_ASC = 'sort-amount-asc';
const _SORT_AMOUNT_DESC = 'sort-amount-desc';
const _SORT_ASC = 'sort-asc';
const _SORT_DESC = 'sort-desc';
const _SORT_DOWN = 'sort-down';
const _SORT_NUMERIC_ASC = 'sort-numeric-asc';
const _SORT_NUMERIC_DESC = 'sort-numeric-desc';
const _SORT_UP = 'sort-up';
const _SOUNDCLOUD = 'soundcloud';
const _SPACE_SHUTTLE = 'space-shuttle';
const _SPINNER = 'spinner';
const _SPOON = 'spoon';
const _SPOTIFY = 'spotify';
const _SQUARE = 'square';
const _SQUARE_O = 'square-o';
const _STACK_EXCHANGE = 'stack-exchange';
const _STACK_OVERFLOW = 'stack-overflow';
const _STAR = 'star';
const _STAR_HALF = 'star-half';
const _STAR_HALF_EMPTY = 'star-half-empty';
const _STAR_HALF_FULL = 'star-half-full';
const _STAR_HALF_O = 'star-half-o';
const _STAR_O = 'star-o';
const _STEAM = 'steam';
const _STEAM_SQUARE = 'steam-square';
const _STEP_BACKWARD = 'step-backward';
const _STEP_FORWARD = 'step-forward';
const _STETHOSCOPE = 'stethoscope';
const _STICKY_NOTE = 'sticky-note';
const _STICKY_NOTE_O = 'sticky-note-o';
const _STOP = 'stop';
const _STOP_CIRCLE = 'stop-circle';
const _STOP_CIRCLE_O = 'stop-circle-o';
const _STREET_VIEW = 'street-view';
const _STRIKETHROUGH = 'strikethrough';
const _STUMBLEUPON = 'stumbleupon';
const _STUMBLEUPON_CIRCLE = 'stumbleupon-circle';
const _SUBSCRIPT = 'subscript';
const _SUBWAY = 'subway';
const _SUITCASE = 'suitcase';
const _SUN_O = 'sun-o';
const _SUPERPOWERS = 'superpowers';
const _SUPERSCRIPT = 'superscript';
const _SUPPORT = 'support';
const _TABLE = 'table';
const _TABLET = 'tablet';
const _TACHOMETER = 'tachometer';
const _TAG = 'tag';
const _TAGS = 'tags';
const _TASKS = 'tasks';
const _TAXI = 'taxi';
const _TELEGRAM = 'telegram';
const _TELEVISION = 'television';
const _TENCENT_WEIBO = 'tencent-weibo';
const _TERMINAL = 'terminal';
const _TEXT_HEIGHT = 'text-height';
const _TEXT_WIDTH = 'text-width';
const _TH = 'th';
const _TH_LARGE = 'th-large';
const _TH_LIST = 'th-list';
const _THEMEISLE = 'themeisle';
const _THERMOMETER = 'thermometer';
const _THERMOMETER_0 = 'thermometer-0';
const _THERMOMETER_1 = 'thermometer-1';
const _THERMOMETER_2 = 'thermometer-2';
const _THERMOMETER_3 = 'thermometer-3';
const _THERMOMETER_4 = 'thermometer-4';
const _THERMOMETER_EMPTY = 'thermometer-empty';
const _THERMOMETER_FULL = 'thermometer-full';
const _THERMOMETER_HALF = 'thermometer-half';
const _THERMOMETER_QUARTER = 'thermometer-quarter';
const _THERMOMETER_THREE_QUARTERS = 'thermometer-three-quarters';
const _THUMB_TACK = 'thumb-tack';
const _THUMBS_DOWN = 'thumbs-down';
const _THUMBS_O_DOWN = 'thumbs-o-down';
const _THUMBS_O_UP = 'thumbs-o-up';
const _THUMBS_UP = 'thumbs-up';
const _TICKET = 'ticket';
const _TIMES = 'times';
const _TIMES_CIRCLE = 'times-circle';
const _TIMES_CIRCLE_O = 'times-circle-o';
const _TIMES_RECTANGLE = 'times-rectangle';
const _TIMES_RECTANGLE_O = 'times-rectangle-o';
const _TINT = 'tint';
const _TOGGLE_DOWN = 'toggle-down';
const _TOGGLE_LEFT = 'toggle-left';
const _TOGGLE_OFF = 'toggle-off';
const _TOGGLE_ON = 'toggle-on';
const _TOGGLE_RIGHT = 'toggle-right';
const _TOGGLE_UP = 'toggle-up';
const _TRADEMARK = 'trademark';
const _TRAIN = 'train';
const _TRANSGENDER = 'transgender';
const _TRANSGENDER_ALT = 'transgender-alt';
const _TRASH = 'trash';
const _TRASH_O = 'trash-o';
const _TREE = 'tree';
const _TRELLO = 'trello';
const _TRIPADVISOR = 'tripadvisor';
const _TROPHY = 'trophy';
const _TRUCK = 'truck';
const _TRY = 'try';
const _TTY = 'tty';
const _TUMBLR = 'tumblr';
const _TUMBLR_SQUARE = 'tumblr-square';
const _TURKISH_LIRA = 'turkish-lira';
const _TV = 'tv';
const _TWITCH = 'twitch';
const _TWITTER = 'twitter';
const _TWITTER_SQUARE = 'twitter-square';
const _UMBRELLA = 'umbrella';
const _UNDERLINE = 'underline';
const _UNDO = 'undo';
const _UNIVERSAL_ACCESS = 'universal-access';
const _UNIVERSITY = 'university';
const _UNLINK = 'unlink';
const _UNLOCK = 'unlock';
const _UNLOCK_ALT = 'unlock-alt';
const _UNSORTED = 'unsorted';
const _UPLOAD = 'upload';
const _USB = 'usb';
const _USD = 'usd';
const _USER = 'user';
const _USER_CIRCLE = 'user-circle';
const _USER_CIRCLE_O = 'user-circle-o';
const _USER_MD = 'user-md';
const _USER_O = 'user-o';
const _USER_PLUS = 'user-plus';
const _USER_SECRET = 'user-secret';
const _USER_TIMES = 'user-times';
const _USERS = 'users';
const _VCARD = 'vcard';
const _VCARD_O = 'vcard-o';
const _VENUS = 'venus';
const _VENUS_DOUBLE = 'venus-double';
const _VENUS_MARS = 'venus-mars';
const _VIACOIN = 'viacoin';
const _VIADEO = 'viadeo';
const _VIADEO_SQUARE = 'viadeo-square';
const _VIDEO_CAMERA = 'video-camera';
const _VIMEO = 'vimeo';
const _VIMEO_SQUARE = 'vimeo-square';
const _VINE = 'vine';
const _VK = 'vk';
const _VOLUME_CONTROL_PHONE = 'volume-control-phone';
const _VOLUME_DOWN = 'volume-down';
const _VOLUME_OFF = 'volume-off';
const _VOLUME_UP = 'volume-up';
const _WARNING = 'warning';
const _WECHAT = 'wechat';
const _WEIBO = 'weibo';
const _WEIXIN = 'weixin';
const _WHATSAPP = 'whatsapp';
const _WHEELCHAIR = 'wheelchair';
const _WHEELCHAIR_ALT = 'wheelchair-alt';
const _WIFI = 'wifi';
const _WIKIPEDIA_W = 'wikipedia-w';
const _WINDOW_CLOSE = 'window-close';
const _WINDOW_CLOSE_O = 'window-close-o';
const _WINDOW_MAXIMIZE = 'window-maximize';
const _WINDOW_MINIMIZE = 'window-minimize';
const _WINDOW_RESTORE = 'window-restore';
const _WINDOWS = 'windows';
const _WON = 'won';
const _WORDPRESS = 'wordpress';
const _WPBEGINNER = 'wpbeginner';
const _WPEXPLORER = 'wpexplorer';
const _WPFORMS = 'wpforms';
const _WRENCH = 'wrench';
const _XING = 'xing';
const _XING_SQUARE = 'xing-square';
const _Y_COMBINATOR = 'y-combinator';
const _Y_COMBINATOR_SQUARE = 'y-combinator-square';
const _YAHOO = 'yahoo';
const _YC = 'yc';
const _YC_SQUARE = 'yc-square';
const _YELP = 'yelp';
const _YEN = 'yen';
const _YOAST = 'yoast';
const _YOUTUBE = 'youtube';
const _YOUTUBE_PLAY = 'youtube-play';
const _YOUTUBE_SQUARE = 'youtube-square';
}

View File

@@ -0,0 +1,106 @@
<?php
/**
* FontAwesome.php
* @author Revin Roman
* @link https://rmrevin.ru
*/
namespace rmrevin\yii\fontawesome;
use rmrevin\yii\fontawesome\component;
/**
* Class FA
* @package rmrevin\yii\fontawesome
*/
class FontAwesome
{
/**
* CSS class prefix
* @var string
*/
public static $cssPrefix = 'fa';
/**
* Creates an `Icon` component that can be used to FontAwesome html icon
*
* @param string $name
* @param array $options
* @return component\Icon
*/
public static function icon($name, $options = [])
{
return new component\Icon($name, $options);
}
/**
* Shortcut for `icon()` method
* @see icon()
*
* @param string $name
* @param array $options
* @return component\Icon
*/
public static function i($name, $options = [])
{
return static::icon($name, $options);
}
/**
* Creates an `Stack` component that can be used to FontAwesome html icon
*
* @param array $options
* @return component\Stack
*/
public static function stack($options = [])
{
return new component\Stack($options);
}
/**
* Shortcut for `stack()` method
* @see stack()
*
* @param array $options
* @return component\Stack
*/
public static function s($options = [])
{
return static::stack($options);
}
/**
* @param array $options
* @return component\UnorderedList
*/
public static function ul($options = [])
{
return new component\UnorderedList($options);
}
/**
* Size values
* @see component\Icon::size
*/
const SIZE_LARGE = 'lg';
const SIZE_2X = '2x';
const SIZE_3X = '3x';
const SIZE_4X = '4x';
const SIZE_5X = '5x';
/**
* Rotate values
* @see component\Icon::rotate
*/
const ROTATE_90 = '90';
const ROTATE_180 = '180';
const ROTATE_270 = '270';
/**
* Flip values
* @see component\Icon::flip
*/
const FLIP_HORIZONTAL = 'horizontal';
const FLIP_VERTICAL = 'vertical';
}

21
vendor/rmrevin/yii2-fontawesome/LICENSE vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Revin Roman Borisovich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,222 @@
Yii 2 [Font Awesome](http://fortawesome.github.io/Font-Awesome/) Asset Bundle
===============================
This extension provides a assets bundle with [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
for [Yii framework 2.0](http://www.yiiframework.com/) applications and helper to use icons.
For license information check the [LICENSE](https://github.com/rmrevin/yii2-fontawesome/blob/master/LICENSE)-file.
[![License](https://poser.pugx.org/rmrevin/yii2-fontawesome/license.svg)](https://packagist.org/packages/rmrevin/yii2-fontawesome)
[![Latest Stable Version](https://poser.pugx.org/rmrevin/yii2-fontawesome/v/stable.svg)](https://packagist.org/packages/rmrevin/yii2-fontawesome)
[![Latest Unstable Version](https://poser.pugx.org/rmrevin/yii2-fontawesome/v/unstable.svg)](https://packagist.org/packages/rmrevin/yii2-fontawesome)
[![Total Downloads](https://poser.pugx.org/rmrevin/yii2-fontawesome/downloads.svg)](https://packagist.org/packages/rmrevin/yii2-fontawesome)
Code Status
-----------
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/rmrevin/yii2-fontawesome/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/rmrevin/yii2-fontawesome/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/rmrevin/yii2-fontawesome/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/rmrevin/yii2-fontawesome/?branch=master)
[![Travis CI Build Status](https://travis-ci.org/rmrevin/yii2-fontawesome.svg)](https://travis-ci.org/rmrevin/yii2-fontawesome)
[![Dependency Status](https://www.versioneye.com/user/projects/54119b799e16229fe00000da/badge.svg)](https://www.versioneye.com/user/projects/54119b799e16229fe00000da)
Support
-------
* [GutHub issues](https://github.com/rmrevin/yii2-fontawesome/issues)
* [Public chat](https://gitter.im/rmrevin/support)
Update to `2.17`
----------------
Be careful in version 2.17 deprecated methods were removed. More in the [changelog](https://github.com/rmrevin/yii2-fontawesome/blob/master/CHANGELOG.md).
Installation
------------
The preferred way to install this extension is through [composer](https://getcomposer.org/).
Either run
```bash
composer require "rmrevin/yii2-fontawesome:~2.17"
```
or add
```
"rmrevin/yii2-fontawesome": "~2.17",
```
to the `require` section of your `composer.json` file.
Usage
-----
In view
```php
rmrevin\yii\fontawesome\AssetBundle::register($this);
```
or as dependency in your main application asset bundle
```php
class AppAsset extends AssetBundle
{
// ...
public $depends = [
// ...
'rmrevin\yii\fontawesome\AssetBundle'
];
}
```
Class reference
---------------
Namespace: `rmrevin\yii\fontawesome`;
###Class `FA` or `FontAwesome`
* `static FA::icon($name, $options=[])` - Creates an [`component\Icon`](#class-componenticon-icon) that can be used to FontAwesome html icon
* `$name` - name of icon in font awesome set.
* `$options` - additional attributes for `i.fa` html tag.
* `static FA::stack($name, $options=[])` - Creates an [`component\Stack`](#class-componentstack-stack) that can be used to FontAwesome html icon
* `$options` - additional attributes for `span.fa-stack` html tag.
###Class `component\Icon` (`$Icon`)
* `(string)$Icon` - render icon
* `$Icon->render()` - DEPRECATED! render icon
* `$Icon->tag($value)` - DEPRECATED! set another html tag for icon (default `i`)
* `$value` - name of tag
* `$Icon->addCssClass($value)` - add to html tag css class in `$value`
* `$value` - name of css class
* `$Icon->inverse()` - add to html tag css class `fa-inverse`
* `$Icon->spin()` - add to html tag css class `fa-spin`
* `$Icon->fixedWidth()` - add to html tag css class `fa-fw`
* `$Icon->ul()` - add to html tag css class `fa-ul`
* `$Icon->li()` - add to html tag css class `fa-li`
* `$Icon->border()` - add to html tag css class `fa-border`
* `$Icon->pullLeft()` - add to html tag css class `pull-left`
* `$Icon->pullRight()` - add to html tag css class `pull-right`
* `$Icon->size($value)` - add to html tag css class with size
* `$value` - size value (variants: `FA::SIZE_LARGE`, `FA::SIZE_2X`, `FA::SIZE_3X`, `FA::SIZE_4X`, `FA::SIZE_5X`)
* `$Icon->rotate($value)` - add to html tag css class with rotate
* `$value` - rotate value (variants: `FA::ROTATE_90`, `FA::ROTATE_180`, `FA::ROTATE_270`)
* `$Icon->flip($value)` - add to html tag css class with rotate
* `$value` - flip value (variants: `FA::FLIP_HORIZONTAL`, `FA::FLIP_VERTICAL`)
###Class `component\Stack` (`$Stack`)
* `(string)$Stack` - render icon stack
* `$Stack->render()` - DEPRECATED! render icon stack
* `$Stack->tag($value)` - DEPRECATED! set another html tag for icon stack (default `span`)
* `$Stack->icon($icon, $options=[])` - set icon for stack
* `$icon` - name of icon or `component\Icon` object
* `$options` - additional attributes for icon html tag.
* `$Stack->icon($icon, $options=[])` - set background icon for stack
* `$icon` - name of icon or `component\Icon` object
* `$options` - additional attributes for icon html tag.
Helper examples
---------------
```php
use rmrevin\yii\fontawesome\FA;
// normal use
echo FA::icon('home'); // <i class="fa fa-home"></i>
// shortcut
echo FA::i('home'); // <i class="fa fa-home"></i>
// icon with additional attributes
echo FA::icon(
'arrow-left',
['class' => 'big', 'data-role' => 'arrow']
); // <i class="big fa fa-arrow-left" data-role="arrow"></i>
// icon in button
echo Html::submitButton(
Yii::t('app', '{icon} Save', ['icon' => FA::icon('check')])
); // <button type="submit"><i class="fa fa-check"></i> Save</button>
// icon with additional methods
echo FA::icon('cog')->inverse(); // <i class="fa fa-cog fa-inverse"></i>
echo FA::icon('cog')->spin(); // <i class="fa fa-cog fa-spin"></i>
echo FA::icon('cog')->fixedWidth(); // <i class="fa fa-cog fa-fw"></i>
echo FA::icon('cog')->li(); // <i class="fa fa-cog fa-li"></i>
echo FA::icon('cog')->border(); // <i class="fa fa-cog fa-border"></i>
echo FA::icon('cog')->pullLeft(); // <i class="fa fa-cog pull-left"></i>
echo FA::icon('cog')->pullRight(); // <i class="fa fa-cog pull-right"></i>
// icon size
echo FA::icon('cog')->size(FA::SIZE_3X);
// values: FA::SIZE_LARGE, FA::SIZE_2X, FA::SIZE_3X, FA::SIZE_4X, FA::SIZE_5X
// <i class="fa fa-cog fa-size-3x"></i>
// icon rotate
echo FA::icon('cog')->rotate(FA::ROTATE_90);
// values: FA::ROTATE_90, FA::ROTATE_180, FA::ROTATE_180
// <i class="fa fa-cog fa-rotate-90"></i>
// icon flip
echo FA::icon('cog')->flip(FA::FLIP_VERTICAL);
// values: FA::FLIP_HORIZONTAL, FA::FLIP_VERTICAL
// <i class="fa fa-cog fa-flip-vertical"></i>
// icon with multiple methods
echo FA::icon('cog')
->spin()
->fixedWidth()
->pullLeft()
->size(FA::SIZE_LARGE);
// <i class="fa fa-cog fa-spin fa-fw pull-left fa-size-lg"></i>
// icons stack
echo FA::stack()
->icon('twitter')
->on('square-o');
// <span class="fa-stack">
// <i class="fa fa-square-o fa-stack-2x"></i>
// <i class="fa fa-twitter fa-stack-1x"></i>
// </span>
// icons stack with additional attributes
echo FA::stack(['data-role' => 'stacked-icon'])
->on(FA::Icon('square')->inverse())
->icon(FA::Icon('cog')->spin());
// <span class="fa-stack" data-role="stacked-icon">
// <i class="fa fa-square-o fa-inverse fa-stack-2x"></i>
// <i class="fa fa-cog fa-spin fa-stack-1x"></i>
// </span>
// unordered list icons
echo FA::ul(['data-role' => 'unordered-list'])
->item('Bullet item', ['icon' => 'circle'])
->item('Checked item', ['icon' => 'check']);
// <ul class="fa-ul" data-role="unordered-list">
// <li><i class="fa fa-circle fa-li"></i>Bullet item</li>
// <li><i class="fa fa-check fa-li"></i>Checked Item</li>
// </span>
// autocomplete icons name in IDE
echo FA::icon(FA::_COG);
echo FA::icon(FA::_DESKTOP);
echo FA::stack()
->on(FA::_CIRCLE_O)
->icon(FA::_TWITTER);
```
### Set another prefix
```php
FA::$cssPrefix = 'awf';
echo FA::icon('home');
// <i class="awf awf-home"></i>
echo FA::icon('cog')->inverse();
// <i class="awf awf-cog awf-inverse"></i>
```

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

View File

@@ -0,0 +1,23 @@
<?php
/**
* AssetBundle.php
* @author Revin Roman
* @link https://rmrevin.ru
*/
namespace rmrevin\yii\fontawesome\cdn;
/**
* Class AssetBundle
* @package rmrevin\yii\fontawesome
*/
class AssetBundle extends \yii\web\AssetBundle
{
/**
* @inherit
*/
public $css = [
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css',
];
}

View File

@@ -0,0 +1,233 @@
<?php
/**
* Icon.php
* @author Revin Roman
* @link https://rmrevin.ru
*/
namespace rmrevin\yii\fontawesome\component;
use rmrevin\yii\fontawesome\FA;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
/**
* Class Icon
* @package rmrevin\yii\fontawesome\component
*/
class Icon
{
/**
* @deprecated
* @var string
*/
public static $defaultTag = 'i';
/**
* @deprecated
* @var string
*/
private $tag;
/**
* @var array
*/
private $options = [];
/**
* @param string $name
* @param array $options
*/
public function __construct($name, $options = [])
{
Html::addCssClass($options, FA::$cssPrefix);
if (!empty($name)) {
Html::addCssClass($options, FA::$cssPrefix . '-' . $name);
}
$this->options = $options;
}
/**
* @return string
*/
public function __toString()
{
$options = $this->options;
$tag = ArrayHelper::remove($options, 'tag', 'i');
return Html::tag($tag, null, $options);
}
/**
* @return self
*/
public function inverse()
{
return $this->addCssClass(FA::$cssPrefix . '-inverse');
}
/**
* @return self
*/
public function spin()
{
return $this->addCssClass(FA::$cssPrefix . '-spin');
}
/**
* @return self
*/
public function fixedWidth()
{
return $this->addCssClass(FA::$cssPrefix . '-fw');
}
/**
* @return self
*/
public function li()
{
return $this->addCssClass(FA::$cssPrefix . '-li');
}
/**
* @return self
*/
public function border()
{
return $this->addCssClass(FA::$cssPrefix . '-border');
}
/**
* @return self
*/
public function pullLeft()
{
return $this->addCssClass(FA::$cssPrefix . '-pull-left');
}
/**
* @return self
*/
public function pullRight()
{
return $this->addCssClass(FA::$cssPrefix . '-pull-right');
}
/**
* @param string $value
* @return self
* @throws \yii\base\InvalidConfigException
*/
public function size($value)
{
return $this->addCssClass(
FA::$cssPrefix . '-' . $value,
in_array((string)$value, [FA::SIZE_LARGE, FA::SIZE_2X, FA::SIZE_3X, FA::SIZE_4X, FA::SIZE_5X], true),
sprintf(
'%s - invalid value. Use one of the constants: %s.',
'FA::size()',
'FA::SIZE_LARGE, FA::SIZE_2X, FA::SIZE_3X, FA::SIZE_4X, FA::SIZE_5X'
)
);
}
/**
* @param string $value
* @return self
* @throws \yii\base\InvalidConfigException
*/
public function rotate($value)
{
return $this->addCssClass(
FA::$cssPrefix . '-rotate-' . $value,
in_array((string)$value, [FA::ROTATE_90, FA::ROTATE_180, FA::ROTATE_270], true),
sprintf(
'%s - invalid value. Use one of the constants: %s.',
'FA::rotate()',
'FA::ROTATE_90, FA::ROTATE_180, FA::ROTATE_270'
)
);
}
/**
* @param string $value
* @return self
* @throws \yii\base\InvalidConfigException
*/
public function flip($value)
{
return $this->addCssClass(
FA::$cssPrefix . '-flip-' . $value,
in_array((string)$value, [FA::FLIP_HORIZONTAL, FA::FLIP_VERTICAL], true),
sprintf(
'%s - invalid value. Use one of the constants: %s.',
'FA::flip()',
'FA::FLIP_HORIZONTAL, FA::FLIP_VERTICAL'
)
);
}
/**
* @deprecated
* Change html tag.
* @param string $tag
* @return static
* @throws \yii\base\InvalidParamException
*/
public function tag($tag)
{
$this->tag = $tag;
$this->options['tag'] = $tag;
return $this;
}
/**
* @param string $class
* @param bool $condition
* @param string|bool $throw
* @return \rmrevin\yii\fontawesome\component\Icon
* @throws \yii\base\InvalidConfigException
* @codeCoverageIgnore
*/
public function addCssClass($class, $condition = true, $throw = false)
{
if ($condition === false) {
if (!empty($throw)) {
$message = !is_string($throw)
? 'Condition is false'
: $throw;
throw new \yii\base\InvalidConfigException($message);
}
} else {
Html::addCssClass($this->options, $class);
}
return $this;
}
/**
* @deprecated
* @param string|null $tag
* @param string|null $content
* @param array $options
* @return string
*/
public function render($tag = null, $content = null, $options = [])
{
$tag = empty($tag)
? (empty($this->tag) ? static::$defaultTag : $this->tag)
: $tag;
$options = array_merge($this->options, $options);
return Html::tag($tag, $content, $options);
}
}

View File

@@ -0,0 +1,161 @@
<?php
/**
* Stack.php
* @author Revin Roman
* @link https://rmrevin.ru
*/
namespace rmrevin\yii\fontawesome\component;
use rmrevin\yii\fontawesome\FA;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
/**
* Class Stack
* @package rmrevin\yii\fontawesome\component
*/
class Stack
{
/**
* @deprecated
* @var string
*/
public static $defaultTag = 'span';
/**
* @deprecated
* @var string
*/
private $tag;
/**
* @var array
*/
private $options = [];
/**
* @var Icon
*/
private $icon_front;
/**
* @var Icon
*/
private $icon_back;
/**
* @param array $options
*/
public function __construct($options = [])
{
Html::addCssClass($options, FA::$cssPrefix . '-stack');
$this->options = $options;
}
/**
* @return string
*/
public function __toString()
{
$options = $this->options;
$tag = ArrayHelper::remove($options, 'tag', 'span');
$template = ArrayHelper::remove($options, 'template', '{back}{front}');
$icon_back = $this->icon_back instanceof Icon
? $this->icon_back->addCssClass(FA::$cssPrefix . '-stack-2x')
: null;
$icon_front = $this->icon_front instanceof Icon
? $this->icon_front->addCssClass(FA::$cssPrefix . '-stack-1x')
: null;
$content = str_replace(['{back}', '{front}'], [$icon_back, $icon_front], $template);
return Html::tag($tag, $content, $options);
}
/**
* @param string|Icon $icon
* @param array $options
* @return self
*/
public function icon($icon, $options = [])
{
if (is_string($icon)) {
$icon = new Icon($icon, $options);
}
$this->icon_front = $icon;
return $this;
}
/**
* @param string|Icon $icon
* @param array $options
* @return self
*/
public function on($icon, $options = [])
{
if (is_string($icon)) {
$icon = new Icon($icon, $options);
}
$this->icon_back = $icon;
return $this;
}
/**
* @deprecated
* Change html tag.
* @param string $tag
* @return static
* @throws \yii\base\InvalidParamException
*/
public function tag($tag)
{
$this->tag = $tag;
$this->options['tag'] = $tag;
return $this;
}
/**
* @deprecated
* @param string|null $tag
* @param array $options
* @return string
* @throws \yii\base\InvalidConfigException
*/
public function render($tag = null, $options = [])
{
$tag = empty($tag)
? (empty($this->tag) ? static::$defaultTag : $this->tag)
: $tag;
$options = array_merge($this->options, $options);
$template = ArrayHelper::remove($options, 'template', '{back}{front}');
$icon_back = $this->icon_back instanceof Icon
? $this->icon_back->addCssClass(FA::$cssPrefix . '-stack-2x')
: null;
$icon_front = $this->icon_front instanceof Icon
? $this->icon_front->addCssClass(FA::$cssPrefix . '-stack-1x')
: null;
return Html::tag(
$tag,
str_replace(['{back}', '{front}'], [$icon_back, $icon_front], $template),
$options
);
}
}

View File

@@ -0,0 +1,123 @@
<?php
/**
* UnorderedList.php
* @author Revin Roman
* @link https://rmrevin.com
*/
namespace rmrevin\yii\fontawesome\component;
use rmrevin\yii\fontawesome\FA;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
/**
* Class UnorderedList
* @package rmrevin\yii\fontawesome\component
*/
class UnorderedList
{
/**
* @deprecated
* @var string
*/
public static $defaultTag = 'ul';
/**
* @deprecated
* @var string
*/
private $tag;
/**
* @var array
*/
protected $options = [];
/**
* @var array
*/
protected $items = [];
/**
* @param array $options
*/
public function __construct($options = [])
{
Html::addCssClass($options, FA::$cssPrefix . '-ul');
$options['item'] = function ($item, $index) {
return call_user_func($item, $index);
};
$this->options = $options;
}
/**
* @return string
*/
public function __toString()
{
return Html::ul($this->items, $this->options);
}
/**
* @param string $label
* @param array $options
* @return static
*/
public function item($label, $options = [])
{
$this->items[] = function ($index) use ($label, $options) {
$tag = ArrayHelper::remove($options, 'tag', 'li');
$icon = ArrayHelper::remove($options, 'icon');
$icon = empty($icon)
? null
: (is_string($icon) ? (string)(new Icon($icon))->li() : $icon);
$content = trim($icon . $label);
return Html::tag($tag, $content, $options);
};
return $this;
}
/**
* @deprecated
* Change html tag.
* @param string $tag
* @return static
* @throws \yii\base\InvalidParamException
*/
public function tag($tag)
{
$this->tag = $tag;
$this->options['tag'] = $tag;
return $this;
}
/**
* @deprecated
* @param string|null $tag
* @param array $options
* @return string
* @throws \yii\base\InvalidConfigException
*/
public function render($tag = null, $options = [])
{
$tag = empty($tag)
? (empty($this->tag) ? static::$defaultTag : $this->tag)
: $tag;
$options = array_merge($this->options, $options);
$items = $this->items;
return Html::tag($tag, implode($items), $options);
}
}

View File

@@ -0,0 +1,41 @@
{
"name": "rmrevin/yii2-fontawesome",
"description": "Asset Bundle for Yii2 with Font Awesome",
"keywords": [
"yii",
"font",
"awesome",
"asset",
"bundle"
],
"type": "yii2-extension",
"license": "MIT",
"minimum-stability": "stable",
"support": {
"issues": "https://github.com/rmrevin/yii2-fontawesome/issues",
"source": "https://github.com/rmrevin/yii2-fontawesome"
},
"authors": [
{
"name": "Revin Roman",
"email": "roman@rmrevin.com",
"homepage": "https://rmrevin.com/"
}
],
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "2.0.*",
"fortawesome/font-awesome": "~4.7"
},
"autoload": {
"psr-4": {
"rmrevin\\yii\\fontawesome\\": ""
}
},
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}

453
vendor/rmrevin/yii2-fontawesome/composer.lock generated vendored Normal file
View File

@@ -0,0 +1,453 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "8666331807f83c718fb59190a8d2c520",
"content-hash": "fa9dd467f05d76715508efdac208de40",
"packages": [
{
"name": "bower-asset/jquery",
"version": "2.2.4",
"source": {
"type": "git",
"url": "https://github.com/jquery/jquery-dist.git",
"reference": "c0185ab7c75aab88762c5aae780b9d83b80eda72"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jquery/jquery-dist/zipball/c0185ab7c75aab88762c5aae780b9d83b80eda72",
"reference": "c0185ab7c75aab88762c5aae780b9d83b80eda72",
"shasum": ""
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": "dist/jquery.js",
"bower-asset-ignore": [
"package.json"
]
},
"license": [
"MIT"
],
"keywords": [
"browser",
"javascript",
"jquery",
"library"
]
},
{
"name": "bower-asset/jquery.inputmask",
"version": "3.2.7",
"source": {
"type": "git",
"url": "https://github.com/RobinHerbots/jquery.inputmask.git",
"reference": "5a72c563b502b8e05958a524cdfffafe9987be38"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/RobinHerbots/jquery.inputmask/zipball/5a72c563b502b8e05958a524cdfffafe9987be38",
"reference": "5a72c563b502b8e05958a524cdfffafe9987be38",
"shasum": ""
},
"require": {
"bower-asset/jquery": ">=1.7"
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": [
"./dist/inputmask/inputmask.js"
],
"bower-asset-ignore": [
"**/*",
"!dist/*",
"!dist/inputmask/*",
"!dist/min/*",
"!dist/min/inputmask/*",
"!extra/bindings/*",
"!extra/dependencyLibs/*",
"!extra/phone-codes/*"
]
},
"license": [
"http://opensource.org/licenses/mit-license.php"
],
"description": "jquery.inputmask is a jquery plugin which create an input mask.",
"keywords": [
"form",
"input",
"inputmask",
"jquery",
"mask",
"plugins"
]
},
{
"name": "bower-asset/punycode",
"version": "v1.3.2",
"source": {
"type": "git",
"url": "https://github.com/bestiejs/punycode.js.git",
"reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bestiejs/punycode.js/zipball/38c8d3131a82567bfef18da09f7f4db68c84f8a3",
"reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3",
"shasum": ""
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": "punycode.js",
"bower-asset-ignore": [
"coverage",
"tests",
".*",
"component.json",
"Gruntfile.js",
"node_modules",
"package.json"
]
}
},
{
"name": "bower-asset/yii2-pjax",
"version": "v2.0.6",
"source": {
"type": "git",
"url": "https://github.com/yiisoft/jquery-pjax.git",
"reference": "60728da6ade5879e807a49ce59ef9a72039b8978"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/60728da6ade5879e807a49ce59ef9a72039b8978",
"reference": "60728da6ade5879e807a49ce59ef9a72039b8978",
"shasum": ""
},
"require": {
"bower-asset/jquery": ">=1.8"
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": "./jquery.pjax.js",
"bower-asset-ignore": [
".travis.yml",
"Gemfile",
"Gemfile.lock",
"CONTRIBUTING.md",
"vendor/",
"script/",
"test/"
]
},
"license": [
"MIT"
]
},
{
"name": "cebe/markdown",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/cebe/markdown.git",
"reference": "c30eb5e01fe021cc5bba2f9ee0eeef96d4931166"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cebe/markdown/zipball/c30eb5e01fe021cc5bba2f9ee0eeef96d4931166",
"reference": "c30eb5e01fe021cc5bba2f9ee0eeef96d4931166",
"shasum": ""
},
"require": {
"lib-pcre": "*",
"php": ">=5.4.0"
},
"require-dev": {
"cebe/indent": "*",
"facebook/xhprof": "*@dev",
"phpunit/phpunit": "4.1.*"
},
"bin": [
"bin/markdown"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"cebe\\markdown\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Carsten Brandt",
"email": "mail@cebe.cc",
"homepage": "http://cebe.cc/",
"role": "Creator"
}
],
"description": "A super fast, highly extensible markdown parser for PHP",
"homepage": "https://github.com/cebe/markdown#readme",
"keywords": [
"extensible",
"fast",
"gfm",
"markdown",
"markdown-extra"
],
"time": "2016-09-14 20:40:20"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.8.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2",
"reference": "d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"type": "library",
"autoload": {
"psr-0": {
"HTMLPurifier": "library/"
},
"files": [
"library/HTMLPurifier.composer.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"time": "2016-07-16 12:58:58"
},
{
"name": "fortawesome/font-awesome",
"version": "v4.7.0",
"source": {
"type": "git",
"url": "https://github.com/FortAwesome/Font-Awesome.git",
"reference": "a8386aae19e200ddb0f6845b5feeee5eb7013687"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FortAwesome/Font-Awesome/zipball/a8386aae19e200ddb0f6845b5feeee5eb7013687",
"reference": "a8386aae19e200ddb0f6845b5feeee5eb7013687",
"shasum": ""
},
"require-dev": {
"jekyll": "1.0.2",
"lessc": "1.4.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.6.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"OFL-1.1",
"MIT"
],
"authors": [
{
"name": "Dave Gandy",
"email": "dave@fontawesome.io",
"homepage": "http://twitter.com/davegandy",
"role": "Developer"
}
],
"description": "The iconic font and CSS framework",
"homepage": "http://fontawesome.io/",
"keywords": [
"FontAwesome",
"awesome",
"bootstrap",
"font",
"icon"
],
"time": "2016-10-24 15:52:54"
},
{
"name": "yiisoft/yii2",
"version": "2.0.10",
"source": {
"type": "git",
"url": "https://github.com/yiisoft/yii2-framework.git",
"reference": "5bfcb7a6dfa9771e2248eb8c4448613330f343ff"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/5bfcb7a6dfa9771e2248eb8c4448613330f343ff",
"reference": "5bfcb7a6dfa9771e2248eb8c4448613330f343ff",
"shasum": ""
},
"require": {
"bower-asset/jquery": "2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable",
"bower-asset/jquery.inputmask": "~3.2.2",
"bower-asset/punycode": "1.3.*",
"bower-asset/yii2-pjax": "~2.0.1",
"cebe/markdown": "~1.0.0 | ~1.1.0",
"ext-ctype": "*",
"ext-mbstring": "*",
"ezyang/htmlpurifier": "~4.6",
"lib-pcre": "*",
"php": ">=5.4.0",
"yiisoft/yii2-composer": "~2.0.4"
},
"bin": [
"yii"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"yii\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Qiang Xue",
"email": "qiang.xue@gmail.com",
"homepage": "http://www.yiiframework.com/",
"role": "Founder and project lead"
},
{
"name": "Alexander Makarov",
"email": "sam@rmcreative.ru",
"homepage": "http://rmcreative.ru/",
"role": "Core framework development"
},
{
"name": "Maurizio Domba",
"homepage": "http://mdomba.info/",
"role": "Core framework development"
},
{
"name": "Carsten Brandt",
"email": "mail@cebe.cc",
"homepage": "http://cebe.cc/",
"role": "Core framework development"
},
{
"name": "Timur Ruziev",
"email": "resurtm@gmail.com",
"homepage": "http://resurtm.com/",
"role": "Core framework development"
},
{
"name": "Paul Klimov",
"email": "klimov.paul@gmail.com",
"role": "Core framework development"
},
{
"name": "Dmitry Naumenko",
"email": "d.naumenko.a@gmail.com",
"role": "Core framework development"
}
],
"description": "Yii PHP Framework Version 2",
"homepage": "http://www.yiiframework.com/",
"keywords": [
"framework",
"yii2"
],
"time": "2016-10-20 12:02:50"
},
{
"name": "yiisoft/yii2-composer",
"version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/yiisoft/yii2-composer.git",
"reference": "7452fd908a5023b8bb5ea1b123a174ca080de464"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/7452fd908a5023b8bb5ea1b123a174ca080de464",
"reference": "7452fd908a5023b8bb5ea1b123a174ca080de464",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0"
},
"type": "composer-plugin",
"extra": {
"class": "yii\\composer\\Plugin",
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"yii\\composer\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Qiang Xue",
"email": "qiang.xue@gmail.com"
}
],
"description": "The composer plugin for Yii extension installer",
"keywords": [
"composer",
"extension installer",
"yii2"
],
"time": "2016-02-06 00:49:24"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.5.0"
},
"platform-dev": []
}

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="./tests/unit/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false">
<filter>
<whitelist>
<directory suffix=".php">./</directory>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>
<testsuites>
<testsuite name="Test Suite">
<directory>./tests/unit/fontawesome</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="./coverage"/>
</logging>
</phpunit>

View File

@@ -0,0 +1 @@
runtime/cache/*

View File

@@ -0,0 +1,73 @@
<?php
/**
* TestCase.php
* @author Revin Roman
* @link https://rmrevin.ru
*/
namespace rmrevin\yii\fontawesome\tests\unit;
use yii\helpers\ArrayHelper;
/**
* Class TestCase
* @package rmrevin\yii\fontawesome\tests\unit
* This is the base class for all yii framework unit tests.
*/
abstract class TestCase extends \PHPUnit_Framework_TestCase
{
public static $params;
protected function setUp()
{
parent::setUp();
$this->mock_application();
}
/**
* Populates Yii::$app with a new application
* The application will be destroyed on tearDown() automatically.
* @param string $appClass
*/
protected function mock_application($appClass = '\yii\console\Application')
{
// for update self::$params
$this->get_param('id');
/** @var \yii\console\Application $app */
new $appClass(self::$params);
}
/**
* Returns a test configuration param from /data/config.php
* @param string $name params name
* @param mixed $default default value to use when param is not set.
* @return mixed the value of the configuration param
*/
public function get_param($name, $default = null)
{
if (self::$params === null) {
self::$params = require(__DIR__ . '/config/main.php');
$main_local = __DIR__ . '/config/main-local.php';
if (file_exists($main_local)) {
self::$params = ArrayHelper::merge(self::$params, require($main_local));
}
}
return isset(self::$params[$name]) ? self::$params[$name] : $default;
}
protected function tearDown()
{
parent::tearDown();
}
/**
* Destroys application in Yii::$app by setting it to null.
*/
protected function destroy_application()
{
\Yii::$app = null;
}
}

View File

@@ -0,0 +1,18 @@
<?php
/**
* bootstrap.php
* @author Revin Roman
* @link https://rmrevin.ru
*/
define('YII_ENABLE_ERROR_HANDLER', true);
define('YII_DEBUG', true);
$_SERVER['SCRIPT_NAME'] = '/' . __DIR__;
$_SERVER['SCRIPT_FILENAME'] = __FILE__;
require_once(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
require_once(__DIR__ . '/../../vendor/autoload.php');
Yii::setAlias('@yiiunit', __DIR__);
require_once(__DIR__ . '/TestCase.php');

View File

@@ -0,0 +1 @@
main-local.php

View File

@@ -0,0 +1,18 @@
<?php
/**
* main.php
* @author Roman Revin http://phptime.ru
*/
$baseDir = realpath(__DIR__ . '/..');
return [
'id' => 'testapp',
'basePath' => $baseDir,
'aliases' => [
'@web' => '/',
'@webroot' => $baseDir . '/runtime',
'@vendor' => realpath($baseDir . '/../../vendor'),
'@bower' => realpath($baseDir . '/../../vendor/bower'),
]
];

View File

@@ -0,0 +1,252 @@
<?php
/**
* MainTest.php
* @author Revin Roman
* @link https://rmrevin.ru
*/
namespace rmrevin\yii\fontawesome\tests\unit\fontawesome;
use rmrevin\yii\fontawesome\component\Icon;
use rmrevin\yii\fontawesome\FA;
use rmrevin\yii\fontawesome\FontAwesome;
/**
* Class MainTest
* @package rmrevin\yii\fontawesome\tests\unit\fontawesome
*/
class MainTest extends \rmrevin\yii\fontawesome\tests\unit\TestCase
{
public function testMain()
{
$this->assertInstanceOf('rmrevin\yii\fontawesome\FA', new FA());
$this->assertInstanceOf('rmrevin\yii\fontawesome\FontAwesome', new FA());
$this->assertInstanceOf('rmrevin\yii\fontawesome\FontAwesome', new FontAwesome());
$Icon = FA::icon('cog');
$this->assertInstanceOf('rmrevin\yii\fontawesome\component\Icon', $Icon);
$Stack = FA::stack();
$this->assertInstanceOf('rmrevin\yii\fontawesome\component\Stack', $Stack);
}
public function testStackOutput()
{
$this->assertEquals(
(string)FA::s(),
'<span class="fa-stack"></span>'
);
$this->assertEquals(
(string)FA::stack(),
'<span class="fa-stack"></span>'
);
$this->assertEquals(
(string)FA::stack()->tag('div'),
'<div class="fa-stack"></div>'
);
$this->assertEquals(
(string)FA::stack(['tag' => 'div']),
'<div class="fa-stack"></div>'
);
$this->assertEquals(
(string)FA::stack()
->icon('cog'),
'<span class="fa-stack"><i class="fa fa-cog fa-stack-1x"></i></span>'
);
$this->assertEquals(
(string)FA::stack()
->on('square-o'),
'<span class="fa-stack"><i class="fa fa-square-o fa-stack-2x"></i></span>'
);
$this->assertEquals(
(string)FA::stack()
->icon('cog')
->on('square-o'),
'<span class="fa-stack"><i class="fa fa-square-o fa-stack-2x"></i><i class="fa fa-cog fa-stack-1x"></i></span>'
);
$this->assertEquals(
(string)FA::stack(['data-role' => 'stack'])
->icon('cog', ['data-role' => 'icon',])
->on('square-o', ['data-role' => 'background']),
'<span class="fa-stack" data-role="stack"><i class="fa fa-square-o fa-stack-2x" data-role="background"></i><i class="fa fa-cog fa-stack-1x" data-role="icon"></i></span>'
);
$this->assertEquals(
(string)FA::stack()
->icon((new Icon('cog'))->spin())
->on((new Icon('square-o'))->size(FA::SIZE_3X)),
'<span class="fa-stack"><i class="fa fa-square-o fa-3x fa-stack-2x"></i><i class="fa fa-cog fa-spin fa-stack-1x"></i></span>'
);
$this->assertEquals(
(string)FA::stack()
->icon(FA::Icon('cog')->spin())
->on(FA::Icon('square-o')->size(FA::SIZE_3X)),
'<span class="fa-stack"><i class="fa fa-square-o fa-3x fa-stack-2x"></i><i class="fa fa-cog fa-spin fa-stack-1x"></i></span>'
);
$this->assertNotEquals(
(string)FA::stack()
->icon((string)FA::Icon('cog')->spin())
->on((string)FA::Icon('square-o')->size(FA::SIZE_3X)),
'<span class="fa-stack"><i class="fa fa-square-o fa-3x fa-stack-2x"></i><i class="fa fa-cog fa-spin fa-stack-1x"></i></span>'
);
}
public function testUlOutput()
{
$this->assertEquals(
(string)FA::ul(),
'<ul class="fa-ul"></ul>'
);
$this->assertEquals(
(string)FA::ul()
->item('Gear', ['icon' => 'cog']),
"<ul class=\"fa-ul\">\n<li><i class=\"fa fa-cog fa-li\"></i>Gear</li>\n</ul>"
);
$this->assertEquals(
(string)FA::ul()
->item('Check', ['icon' => 'check'])
->item('Gear', ['icon' => 'cog']),
"<ul class=\"fa-ul\">\n<li><i class=\"fa fa-check fa-li\"></i>Check</li>\n<li><i class=\"fa fa-cog fa-li\"></i>Gear</li>\n</ul>"
);
$this->assertEquals(
(string)FA::ul()
->tag('ol')
->item('Check', ['icon' => 'check'])
->item('Gear', ['icon' => 'cog']),
"<ol class=\"fa-ul\">\n<li><i class=\"fa fa-check fa-li\"></i>Check</li>\n<li><i class=\"fa fa-cog fa-li\"></i>Gear</li>\n</ol>"
);
$this->assertEquals(
(string)FA::ul(['tag' => 'ol'])
->item('Check', ['icon' => 'check'])
->item('Gear', ['icon' => 'cog']),
"<ol class=\"fa-ul\">\n<li><i class=\"fa fa-check fa-li\"></i>Check</li>\n<li><i class=\"fa fa-cog fa-li\"></i>Gear</li>\n</ol>"
);
$this->assertEquals(
(string)FA::ul()
->item('Check', ['icon' => 'check', 'class' => 'another-class']),
"<ul class=\"fa-ul\">\n<li class=\"another-class\"><i class=\"fa fa-check fa-li\"></i>Check</li>\n</ul>"
);
}
public function testAnotherPrefix()
{
$old_prefix = FA::$cssPrefix;
FA::$cssPrefix = 'fontawesome';
$this->assertEquals(FA::icon('cog'), '<i class="fontawesome fontawesome-cog"></i>');
$this->assertEquals(FA::icon('cog')->tag('span'), '<span class="fontawesome fontawesome-cog"></span>');
$this->assertEquals(FA::icon('cog', ['tag' => 'span']), '<span class="fontawesome fontawesome-cog"></span>');
$this->assertEquals(FA::icon('cog')->addCssClass('highlight'), '<i class="fontawesome fontawesome-cog highlight"></i>');
$this->assertEquals(
(string)FA::stack()
->icon(FA::Icon('cog')->spin())
->on(FA::Icon('square-o')->size(FA::SIZE_3X)),
'<span class="fontawesome-stack"><i class="fontawesome fontawesome-square-o fontawesome-3x fontawesome-stack-2x"></i><i class="fontawesome fontawesome-cog fontawesome-spin fontawesome-stack-1x"></i></span>'
);
$this->assertEquals(
(string)FA::ul()
->item('Gear', ['icon' => 'cog']),
"<ul class=\"fontawesome-ul\">\n<li><i class=\"fontawesome fontawesome-cog fontawesome-li\"></i>Gear</li>\n</ul>"
);
FA::$cssPrefix = $old_prefix;
}
public function testIconOutput()
{
$this->assertEquals(FA::i('cog'), '<i class="fa fa-cog"></i>');
$this->assertEquals(FA::icon('cog'), '<i class="fa fa-cog"></i>');
$this->assertEquals(FA::icon('cog')->tag('span'), '<span class="fa fa-cog"></span>');
$this->assertEquals(FA::icon('cog', ['tag' => 'span']), '<span class="fa fa-cog"></span>');
$this->assertEquals(FA::icon('cog')->addCssClass('highlight'), '<i class="fa fa-cog highlight"></i>');
$this->assertEquals(FA::icon('cog')->inverse(), '<i class="fa fa-cog fa-inverse"></i>');
$this->assertEquals(FA::icon('cog')->spin(), '<i class="fa fa-cog fa-spin"></i>');
$this->assertEquals(FA::icon('cog')->fixedWidth(), '<i class="fa fa-cog fa-fw"></i>');
$this->assertEquals(FA::icon('cog')->li(), '<i class="fa fa-cog fa-li"></i>');
$this->assertEquals(FA::icon('cog')->border(), '<i class="fa fa-cog fa-border"></i>');
$this->assertEquals(FA::icon('cog')->pullLeft(), '<i class="fa fa-cog fa-pull-left"></i>');
$this->assertEquals(FA::icon('cog')->pullRight(), '<i class="fa fa-cog fa-pull-right"></i>');
$this->assertEquals(FA::icon('cog')->size(FA::SIZE_2X), '<i class="fa fa-cog fa-2x"></i>');
$this->assertEquals(FA::icon('cog')->size(FA::SIZE_3X), '<i class="fa fa-cog fa-3x"></i>');
$this->assertEquals(FA::icon('cog')->size(FA::SIZE_4X), '<i class="fa fa-cog fa-4x"></i>');
$this->assertEquals(FA::icon('cog')->size(FA::SIZE_5X), '<i class="fa fa-cog fa-5x"></i>');
$this->assertEquals(FA::icon('cog')->size(FA::SIZE_LARGE), '<i class="fa fa-cog fa-lg"></i>');
$this->assertEquals(FA::icon('cog')->rotate(FA::ROTATE_90), '<i class="fa fa-cog fa-rotate-90"></i>');
$this->assertEquals(FA::icon('cog')->rotate(FA::ROTATE_180), '<i class="fa fa-cog fa-rotate-180"></i>');
$this->assertEquals(FA::icon('cog')->rotate(FA::ROTATE_270), '<i class="fa fa-cog fa-rotate-270"></i>');
$this->assertEquals(FA::icon('cog')->flip(FA::FLIP_HORIZONTAL), '<i class="fa fa-cog fa-flip-horizontal"></i>');
$this->assertEquals(FA::icon('cog')->flip(FA::FLIP_VERTICAL), '<i class="fa fa-cog fa-flip-vertical"></i>');
}
public function testGetConstants()
{
$this->assertNotEmpty(FA::getConstants(false));
$this->assertNotEmpty(FA::getConstants(true));
}
public function testIconSizeException()
{
$this->setExpectedException(
'yii\base\InvalidConfigException',
'FA::size() - invalid value. Use one of the constants: FA::SIZE_LARGE, FA::SIZE_2X, FA::SIZE_3X, FA::SIZE_4X, FA::SIZE_5X.'
);
FA::icon('cog')->size('badvalue');
}
public function testIconRotateException()
{
$this->setExpectedException(
'yii\base\InvalidConfigException',
'FA::rotate() - invalid value. Use one of the constants: FA::ROTATE_90, FA::ROTATE_180, FA::ROTATE_270.'
);
FA::icon('cog')->rotate('badvalue');
}
public function testIconFlipException()
{
$this->setExpectedException(
'yii\base\InvalidConfigException',
'FA::flip() - invalid value. Use one of the constants: FA::FLIP_HORIZONTAL, FA::FLIP_VERTICAL.'
);
FA::icon('cog')->flip('badvalue');
}
public function testIconAddCssClassCondition()
{
$this->assertEquals(FA::$cssPrefix, 'fa');
$this->assertEquals(FA::icon('cog')->addCssClass('highlight', true), '<i class="fa fa-cog highlight"></i>');
$this->setExpectedException(
'yii\base\InvalidConfigException',
'Condition is false'
);
FA::icon('cog')->addCssClass('highlight', false, true);
}
}

View File

@@ -0,0 +1,3 @@
*
!.gitignore
!assets

View File

@@ -0,0 +1,2 @@
*
!.gitignore