All Projects â†’ awps â†’ Font Awesome Php

awps / Font Awesome Php

Licence: mit
A PHP library for Font Awesome 4.7.

Projects that are alternatives of or similar to Font Awesome Php

Font Awesome Stylus
Stylus port for font-awesome 4.7.0
Stars: ✭ 77 (+63.83%)
Mutual labels:  font, fontawesome, icons, font-awesome
Alfred Font Awesome Workflow
🎩 Font Awesome workflow for Alfred
Stars: ✭ 714 (+1419.15%)
Mutual labels:  font, fontawesome, icons, font-awesome
rofi-fontawesome
fontawesome icon list for rofi dmenu
Stars: ✭ 58 (+23.4%)
Mutual labels:  font, fontawesome, icons, font-awesome
Bootstrapcdn
Free Bootstrap CDN hosting
Stars: ✭ 1,075 (+2187.23%)
Mutual labels:  font, fontawesome, font-awesome
Fontawesome Module
Module to use Font Awesome icons in Nuxt.js
Stars: ✭ 79 (+68.09%)
Mutual labels:  fontawesome, icons, font-awesome
Yii2 Fontawesome
Asset Bundle for Yii2 with Font Awesome http://fortawesome.github.io/Font-Awesome/
Stars: ✭ 149 (+217.02%)
Mutual labels:  font, fontawesome, icons
Svelte Awesome
Awesome SVG icon component for Svelte JS, built with Font Awesome icons. Based on Justineo/vue-awesome
Stars: ✭ 193 (+310.64%)
Mutual labels:  font, icons, font-awesome
Iconfontcppheaders
C, C++ headers and C# classes for icon fonts: Font Awesome, Fork Awesome, Material Design, Kenney game icons and Fontaudio
Stars: ✭ 509 (+982.98%)
Mutual labels:  fontawesome, icons, font-awesome
Swifticons
🎢Swift Library for Font Icons - ★ this library
Stars: ✭ 747 (+1489.36%)
Mutual labels:  fontawesome, icons, font-awesome
Font Awesome
The iconic SVG, font, and CSS toolkit
Stars: ✭ 66,937 (+142319.15%)
Mutual labels:  font, fontawesome, icons
Avfonts
AVFonts for change/swap fontname throughout app.
Stars: ✭ 200 (+325.53%)
Mutual labels:  font, fontawesome, font-awesome
react-native-fontawesome-pro
Easily use your FontAwesome Pro icons in React-Native
Stars: ✭ 44 (-6.38%)
Mutual labels:  fontawesome, icons, font-awesome
FMX.FontAwesome
[FireMonkey] FontAwesome
Stars: ✭ 21 (-55.32%)
Mutual labels:  font, fontawesome, font-awesome
Font Awesome Swift
Font Awesome swift library for iOS.
Stars: ✭ 743 (+1480.85%)
Mutual labels:  font, icons, font-awesome
Qtawesome
QtAwesome - Font Awesome support for Qt applications
Stars: ✭ 430 (+814.89%)
Mutual labels:  font, icons
Radialmenu
A highly customizable radial menu that's very easy to setup.
Stars: ✭ 371 (+689.36%)
Mutual labels:  fontawesome, icons
Glyphsearch
Search for icons from Font Awesome, Glyphicons, IcoMoon, Ionicons, and Octicons
Stars: ✭ 448 (+853.19%)
Mutual labels:  font, font-awesome
React Icons Kit
React Svg Icons
Stars: ✭ 352 (+648.94%)
Mutual labels:  fontawesome, icons
Last Resort Font
Last Resort Font
Stars: ✭ 462 (+882.98%)
Mutual labels:  unicode, font
Fontawesome Iconpicker
Font Awesome Icon Picker component for Bootstrap.
Stars: ✭ 519 (+1004.26%)
Mutual labels:  font, fontawesome

A PHP library for Font Awesome.

This repository contains the necessary data to work with Font Awesome in PHP.

Requirements:

  • Font Awesome 4.7.0
  • PHP 5.3+.

License

Installation

With composer:

composer require awps/font-awesome-php

Manually:

require_once 'src/load.php';

Usage

The library contains 2 main classes that are created for public:

  • Awps\FontAwesome() - Uses a static array of FA icons.(Recommended)
  • Awps\FontAwesomeReader( $css_path ) - Generates the array from font-awesome.css file. You must define the path to this file.

Create an instance:

// Using the reader to dynamically get the icons array. It's resource intensive and you must cache the result.
$css_path = __DIR__ . '/css/font-awesome.css';
$icons    = new Awps\FontAwesomeReader( $css_path );

// .... or better use the static class

$icons = new Awps\FontAwesome();

Next it's easy. You can get the array of icons just by doing this.

$icons->getArray();

// Result:
/*
array (
  'fa-glass' => '\\f000',
  'fa-music' => '\\f001',
  'fa-search' => '\\f002',
  ...
*/

API:

->getAllData()

$icons->getAllData();

// Result:
/*
array (
  'fa-glass' => 
  array (
    'unicode' => '\\f000',
    'name' => 'Glass',
    'class' => 'fa-glass',
  ),
  'fa-music' => 
  array (
    'unicode' => '\\f001',
    'name' => 'Music',
    'class' => 'fa-music',
  ),
  ...
*/

->getCssClasses()

$icons->getCssClasses();

// Result:
/*
array (
  'fa-glass' => 'fa-glass',
  'fa-music' => 'fa-music',
  'fa-search' => 'fa-search',
  ...
*/

->getUnicodeKeys()

$icons->getUnicodeKeys();

// Result:
/*
array (
  'fa-glass' => '\\f000',
  'fa-music' => '\\f001',
  'fa-search' => '\\f002',
  'fa-envelope-o' => '\\f003',
  ...
*/

->getReadableNames()

$icons->getReadableNames();

// Result:
/*
array (
  'fa-glass' => 'Glass',
  'fa-music' => 'Music',
  'fa-search' => 'Search',
  ...
*/

->sortByName()

Attention: This modifies the original array. You can reset it back using ->reset() method.

$icons->sortByName();

// Result:
/*
array (
  'fa-500px' => '\\f26e',
  'fa-address-book' => '\\f2b9',
  'fa-address-book-o' => '\\f2ba',
  'fa-address-card' => '\\f2bb',
  'fa-address-card-o' => '\\f2bc',
  'fa-adjust' => '\\f042',
  ...
*/

Utilities:

->total()

Return the total number of icons from original array.

->getIconUnicode( $icon_class )

Get the unicode by icon class.

Example:

$icons->getIconUnicode( 'fa-address-card' );

// Result
// '\f2bb'

->getIconName( $icon_class )

Get the readable icon name by class.

Example:

$icons->getIconName( 'fa-address-card' );

// Result
// 'Address card'

->getIcon( $icon_class )

Get the details of a single icon by class.

Example:

$icons->getIcon( 'fa-address-card' );

// Result
/*
array (
  'unicode' => '\\f2bb',
  'name' => 'Address card',
  'class' => 'fa-address-card',
)
*/

->getIconByUnicode( $unicode )

Get the details of a single icon by unicode.

Example:

$icons->getIconByUnicode( '\\f004' )

// Result
/*
array (
  'unicode' => '\\f004',
  'name' => 'Heart',
  'class' => 'fa-heart',
)
*/

->reset()

Reset the current array to its original state

Example:

$icons->sortByName();

// Array is sorted:
$icons->getArray();

/*
array (
  'fa-500px' => '\\f26e',
  'fa-address-book' => '\\f2b9',
  'fa-address-book-o' => '\\f2ba',
  'fa-address-card' => '\\f2bb',
  ...
);
*/

// Reset it
$icons->reset();

// This one will return the original array
$icons->getArray();

// Result:
/*
array (
  'fa-glass' => '\\f000',
  'fa-music' => '\\f001',
  'fa-search' => '\\f002',
  ...
);
*/
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].