Skip to content

Instantly share code, notes, and snippets.

@DrMabuse23
Last active December 28, 2015 23:29
Show Gist options
  • Save DrMabuse23/7579643 to your computer and use it in GitHub Desktop.
Save DrMabuse23/7579643 to your computer and use it in GitHub Desktop.
implement Glyphicons
<?php
namespace app\helpers;
/**
* Date: 20.11.13
* Time: 23:00
* Class Glyph
* Create a Glyphicon
*
* For example,
*
* ```php
* echo Glyph::icon(Glyph::GLYPHICON_BELL);
* ```
*
* twig
* $this->twig->addGlobal('glyph',new Glyph());
* {{ glyph.icon(constant('\\app\\helpers\\Glyph::GLYPHICON_BELL'))|raw }}
*
* @author: Pascal Brewing < [email protected] >
* @see http://getbootstrap.com/components/#glyphicons
* @since 2.0
*/
use yii\helpers\Html;
class Glyph {
/**
* @param string $icon
* ```php'['class'] => 'glyphicon '.$icon'```
* @param string $tag
* ```php 'span' ```
* @param string $content
* ```php '' ```
* @param array $htmlOptions
* ```php [] ```
* @return string
*/
public static function icon($icon = '',$tag='span',$content = '',$htmlOptions = []){
Html::addCssClass($htmlOptions,'glyphicon '.$icon);
return Html::tag($tag,$content,$htmlOptions);
}
//
// GLYPHICONS
// --------------------------------------------------
const GLYPHICON_ADJUST = 'glyphicon-adjust';
const GLYPHICON_ALIGN_CENTER = 'glyphicon-align-center';
const GLYPHICON_ALIGN_JUSTIFY = 'glyphicon-align-justify';
const GLYPHICON_ALIGN_LEFT = 'glyphicon-align-left';
const GLYPHICON_ALIGN_RIGHT = 'glyphicon-align-right';
const GLYPHICON_ARROW_DOWN = 'glyphicon-arrow-down';
const GLYPHICON_ARROW_LEFT = 'glyphicon-arrow-left';
const GLYPHICON_ARROW_RIGHT = 'glyphicon-arrow-right';
const GLYPHICON_ARROW_UP = 'glyphicon-arrow-up';
const GLYPHICON_ASTERISK = 'glyphicon-asterisk';
const GLYPHICON_BACKWARD = 'glyphicon-backward';
const GLYPHICON_BAN_CIRCLE = 'glyphicon-ban-circle';
const GLYPHICON_BARCODE = 'glyphicon-barcode';
const GLYPHICON_BELL = 'glyphicon-bell';
const GLYPHICON_BOLD = 'glyphicon-bold';
const GLYPHICON_BOOK = 'glyphicon-book';
const GLYPHICON_BOOKMARK = 'glyphicon-bookmark';
const GLYPHICON_BRIEFCASE = 'glyphicon-briefcase';
const GLYPHICON_BULLHORN = 'glyphicon-bullhorn';
const GLYPHICON_CALENDAR = 'glyphicon-calendar';
const GLYPHICON_CAMERA = 'glyphicon-camera';
const GLYPHICON_CERTIFICATE = 'glyphicon-certificate';
const GLYPHICON_CHECK = 'glyphicon-check';
const GLYPHICON_CHEVRON_DOWN = 'glyphicon-chevron-down';
const GLYPHICON_CHEVRON_LEFT = 'glyphicon-chevron-left';
const GLYPHICON_CHEVRON_RIGHT = 'glyphicon-chevron-right';
const GLYPHICON_CHEVRON_UP = 'glyphicon-chevron-up';
const GLYPHICON_CIRCLE_ARROW_DOWN = 'glyphicon-circle-arrow-down';
const GLYPHICON_CIRCLE_ARROW_LEFT = 'glyphicon-circle-arrow-left';
const GLYPHICON_CIRCLE_ARROW_RIGHT = 'glyphicon-circle-arrow-right';
const GLYPHICON_CIRCLE_ARROW_UP = 'glyphicon-circle-arrow-up';
const GLYPHICON_CLOUD = 'glyphicon-cloud';
const GLYPHICON_CLOUD_DOWNLOAD = 'glyphicon-cloud-download';
const GLYPHICON_CLOUD_UPLOAD = 'glyphicon-cloud-upload';
const GLYPHICON_COG = 'glyphicon-cog';
const GLYPHICON_COLLAPSE_DOWN = 'glyphicon-collapse-down';
const GLYPHICON_COLLAPSE_UP = 'glyphicon-collapse-up';
const GLYPHICON_COMMENT = 'glyphicon-comment';
const GLYPHICON_COMPRESSED = 'glyphicon-compressed';
const GLYPHICON_COPYRIGHT_MARK = 'glyphicon-copyright-mark';
const GLYPHICON_CREDIT_CARD = 'glyphicon-credit-card';
const GLYPHICON_CUTLERY = 'glyphicon-cutlery';
const GLYPHICON_DASHBOARD = 'glyphicon-dashboard';
const GLYPHICON_DOWNLOAD = 'glyphicon-download';
const GLYPHICON_DOWNLOAD_ALT = 'glyphicon-download-alt';
const GLYPHICON_EARPHONE = 'glyphicon-earphone';
const GLYPHICON_EDIT = 'glyphicon-edit';
const GLYPHICON_EJECT = 'glyphicon-eject';
const GLYPHICON_ENVELOPE = 'glyphicon-envelope';
const GLYPHICON_EURO = 'glyphicon-euro';
const GLYPHICON_EXCLAMATION_SIGN = 'glyphicon-exclamation-sign';
const GLYPHICON_EXPAND = 'glyphicon-expand';
const GLYPHICON_EXPORT = 'glyphicon-export';
const GLYPHICON_EYE_CLOSE = 'glyphicon-eye-close';
const GLYPHICON_EYE_OPEN = 'glyphicon-eye-open';
const GLYPHICON_FACETIME_VIDEO = 'glyphicon-facetime-video';
const GLYPHICON_FAST_BACKWARD = 'glyphicon-fast-backward';
const GLYPHICON_FAST_FORWARD = 'glyphicon-fast-forward';
const GLYPHICON_FILE = 'glyphicon-file';
const GLYPHICON_FILM = 'glyphicon-film';
const GLYPHICON_FILTER = 'glyphicon-filter';
const GLYPHICON_FIRE = 'glyphicon-fire';
const GLYPHICON_FLAG = 'glyphicon-flag';
const GLYPHICON_FLASH = 'glyphicon-flash';
const GLYPHICON_FLOPPY_DISK = 'glyphicon-floppy-disk';
const GLYPHICON_FLOPPY_OPEN = 'glyphicon-floppy-open';
const GLYPHICON_FLOPPY_REMOVE = 'glyphicon-floppy-remove';
const GLYPHICON_FLOPPY_SAVE = 'glyphicon-floppy-save';
const GLYPHICON_FLOPPY_SAVED = 'glyphicon-floppy-saved';
const GLYPHICON_FOLDER_CLOSE = 'glyphicon-folder-close';
const GLYPHICON_FOLDER_OPEN = 'glyphicon-folder-open';
const GLYPHICON_FONT = 'glyphicon-font';
const GLYPHICON_FORWARD = 'glyphicon-forward';
const GLYPHICON_FULLSCREEN = 'glyphicon-fullscreen';
const GLYPHICON_GBP = 'glyphicon-gbp';
const GLYPHICON_GIFT = 'glyphicon-gift';
const GLYPHICON_GLASS = 'glyphicon-glass';
const GLYPHICON_GLOBE = 'glyphicon-globe';
const GLYPHICON_HAND_DOWN = 'glyphicon-hand-down';
const GLYPHICON_HAND_LEFT = 'glyphicon-hand-left';
const GLYPHICON_HAND_RIGHT = 'glyphicon-hand-right';
const GLYPHICON_HAND_UP = 'glyphicon-hand-up';
const GLYPHICON_HD_VIDEO = 'glyphicon-hd-video';
const GLYPHICON_HDD = 'glyphicon-hdd';
const GLYPHICON_HEADER = 'glyphicon-header';
const GLYPHICON_HEADPHONES = 'glyphicon-headphones';
const GLYPHICON_HEART = 'glyphicon-heart';
const GLYPHICON_HEART_EMPTY = 'glyphicon-heart-empty';
const GLYPHICON_HOME = 'glyphicon-home';
const GLYPHICON_IMPORT = 'glyphicon-import';
const GLYPHICON_INBOX = 'glyphicon-inbox';
const GLYPHICON_INDENT_LEFT = 'glyphicon-indent-left';
const GLYPHICON_INDENT_RIGHT = 'glyphicon-indent-right';
const GLYPHICON_INFO_SIGN = 'glyphicon-info-sign';
const GLYPHICON_ITALIC = 'glyphicon-italic';
const GLYPHICON_LEAF = 'glyphicon-leaf';
const GLYPHICON_LINK = 'glyphicon-link';
const GLYPHICON_LIST = 'glyphicon-list';
const GLYPHICON_LIST_ALT = 'glyphicon-list-alt';
const GLYPHICON_LOCK = 'glyphicon-lock';
const GLYPHICON_LOG_IN = 'glyphicon-log-in';
const GLYPHICON_LOG_OUT = 'glyphicon-log-out';
const GLYPHICON_MAGNET = 'glyphicon-magnet';
const GLYPHICON_MAP_MARKER = 'glyphicon-map-marker';
const GLYPHICON_MINUS = 'glyphicon-minus';
const GLYPHICON_MINUS_SIGN = 'glyphicon-minus-sign';
const GLYPHICON_MOVE = 'glyphicon-move';
const GLYPHICON_MUSIC = 'glyphicon-music';
const GLYPHICON_NEW_WINDOW = 'glyphicon-new-window';
const GLYPHICON_OFF = 'glyphicon-off';
const GLYPHICON_OK = 'glyphicon-ok';
const GLYPHICON_OK_CIRCLE = 'glyphicon-ok-circle';
const GLYPHICON_OK_SIGN = 'glyphicon-ok-sign';
const GLYPHICON_OPEN = 'glyphicon-open';
const GLYPHICON_PAPERCLIP = 'glyphicon-paperclip';
const GLYPHICON_PAUSE = 'glyphicon-pause';
const GLYPHICON_PENCIL = 'glyphicon-pencil';
const GLYPHICON_PHONE = 'glyphicon-phone';
const GLYPHICON_PHONE_ALT = 'glyphicon-phone-alt';
const GLYPHICON_PICTURE = 'glyphicon-picture';
const GLYPHICON_PLANE = 'glyphicon-plane';
const GLYPHICON_PLAY = 'glyphicon-play';
const GLYPHICON_PLAY_CIRCLE = 'glyphicon-play-circle';
const GLYPHICON_PLUS = 'glyphicon-plus';
const GLYPHICON_PLUS_SIGN = 'glyphicon-plus-sign';
const GLYPHICON_PRINT = 'glyphicon-print';
const GLYPHICON_PUSHPIN = 'glyphicon-pushpin';
const GLYPHICON_QRCODE = 'glyphicon-qrcode';
const GLYPHICON_QUESTION_SIGN = 'glyphicon-question-sign';
const GLYPHICON_RANDOM = 'glyphicon-random';
const GLYPHICON_RECORD = 'glyphicon-record';
const GLYPHICON_REFRESH = 'glyphicon-refresh';
const GLYPHICON_REGISTRATION_MARK = 'glyphicon-registration-mark';
const GLYPHICON_REMOVE = 'glyphicon-remove';
const GLYPHICON_REMOVE_CIRCLE = 'glyphicon-remove-circle';
const GLYPHICON_REMOVE_SIGN = 'glyphicon-remove-sign';
const GLYPHICON_REPEAT = 'glyphicon-repeat';
const GLYPHICON_RESIZE_FULL = 'glyphicon-resize-full';
const GLYPHICON_RESIZE_HORIZONTAL = 'glyphicon-resize-horizontal';
const GLYPHICON_RESIZE_SMALL = 'glyphicon-resize-small';
const GLYPHICON_RESIZE_VERTICAL = 'glyphicon-resize-vertical';
const GLYPHICON_RETWEET = 'glyphicon-retweet';
const GLYPHICON_ROAD = 'glyphicon-road';
const GLYPHICON_SAVE = 'glyphicon-save';
const GLYPHICON_SAVED = 'glyphicon-saved';
const GLYPHICON_SCREENSHOT = 'glyphicon-screenshot';
const GLYPHICON_SD_VIDEO = 'glyphicon-sd-video';
const GLYPHICON_SEARCH = 'glyphicon-search';
const GLYPHICON_SEND = 'glyphicon-send';
const GLYPHICON_SHARE = 'glyphicon-share';
const GLYPHICON_SHARE_ALT = 'glyphicon-share-alt';
const GLYPHICON_SHOPPING_CART = 'glyphicon-shopping-cart';
const GLYPHICON_SIGNAL = 'glyphicon-signal';
const GLYPHICON_SORT = 'glyphicon-sort';
const GLYPHICON_SORT_BY_ALPHABET = 'glyphicon-sort-by-alphabet';
const GLYPHICON_SORT_BY_ALPHABET_ALT = 'glyphicon-sort-by-alphabet-alt';
const GLYPHICON_SORT_BY_ATTRIBUTES = 'glyphicon-sort-by-attributes';
const GLYPHICON_SORT_BY_ATTRIBUTES_ALT = 'glyphicon-sort-by-attributes-alt';
const GLYPHICON_SORT_BY_ORDER = 'glyphicon-sort-by-order';
const GLYPHICON_SORT_BY_ORDER_ALT = 'glyphicon-sort-by-order-alt';
const GLYPHICON_SOUND_5_1 = 'glyphicon-sound-5-1';
const GLYPHICON_SOUND_6_1 = 'glyphicon-sound-6-1';
const GLYPHICON_SOUND_7_1 = 'glyphicon-sound-7-1';
const GLYPHICON_SOUND_DOLBY = 'glyphicon-sound-dolby';
const GLYPHICON_SOUND_STEREO = 'glyphicon-sound-stereo';
const GLYPHICON_STAR = 'glyphicon-star';
const GLYPHICON_STAR_EMPTY = 'glyphicon-star-empty';
const GLYPHICON_STATS = 'glyphicon-stats';
const GLYPHICON_STEP_BACKWARD = 'glyphicon-step-backward';
const GLYPHICON_STEP_FORWARD = 'glyphicon-step-forward';
const GLYPHICON_STOP = 'glyphicon-stop';
const GLYPHICON_SUBTITLES = 'glyphicon-subtitles';
const GLYPHICON_TAG = 'glyphicon-tag';
const GLYPHICON_TAGS = 'glyphicon-tags';
const GLYPHICON_TASKS = 'glyphicon-tasks';
const GLYPHICON_TEXT_HEIGHT = 'glyphicon-text-height';
const GLYPHICON_TEXT_WIDTH = 'glyphicon-text-width';
const GLYPHICON_TH = 'glyphicon-th';
const GLYPHICON_TH_LARGE = 'glyphicon-th-large';
const GLYPHICON_TH_LIST = 'glyphicon-th-list';
const GLYPHICON_THUMBS_DOWN = 'glyphicon-thumbs-down';
const GLYPHICON_THUMBS_UP = 'glyphicon-thumbs-up';
const GLYPHICON_TIME = 'glyphicon-time';
const GLYPHICON_TINT = 'glyphicon-tint';
const GLYPHICON_TOWER = 'glyphicon-tower';
const GLYPHICON_TRANSFER = 'glyphicon-transfer';
const GLYPHICON_TRASH = 'glyphicon-trash';
const GLYPHICON_TREE_CONIFER = 'glyphicon-tree-conifer';
const GLYPHICON_TREE_DECIDUOUS = 'glyphicon-tree-deciduous';
const GLYPHICON_UNCHECKED = 'glyphicon-unchecked';
const GLYPHICON_UPLOAD = 'glyphicon-upload';
const GLYPHICON_USD = 'glyphicon-usd';
const GLYPHICON_USER = 'glyphicon-user';
const GLYPHICON_VOLUME_DOWN = 'glyphicon-volume-down';
const GLYPHICON_VOLUME_OFF = 'glyphicon-volume-off';
const GLYPHICON_VOLUME_UP = 'glyphicon-volume-up';
const GLYPHICON_WARNING_SIGN = 'glyphicon-warning-sign';
const GLYPHICON_WRENCH = 'glyphicon-wrench';
const GLYPHICON_ZOOM_IN = 'glyphicon-zoom-in';
const GLYPHICON_ZOOM_OUT = 'glyphicon-zoom-out';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment