Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/z-song/easy-fa
An elegant way to use Font-Awesome for PHPer.
https://github.com/z-song/easy-fa
Last synced: 2 months ago
JSON representation
An elegant way to use Font-Awesome for PHPer.
- Host: GitHub
- URL: https://github.com/z-song/easy-fa
- Owner: z-song
- License: mit
- Created: 2016-10-24T10:08:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-25T10:21:32.000Z (about 8 years ago)
- Last Synced: 2024-05-02T01:09:05.407Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Easy FontAwesome
=====The elegant way to use [font-awesome](http://fontawesome.io/icons/) for PHPer.
Inspired by [FontAwesomePHP](https://github.com/kevinkhill/FontAwesomePHP)
Installation
-----------```
composer require encore/easy-fa
```Example Usage
-----------To use it in Laravel project, first add service provider in `app.php`
```php
Encore\EasyFontAwesome\FontAwesomeServiceProvider::class,
```In views
```php
FontAwesome example
{!! fa_assets() !!}
{!! fa('envelope') !!}
{!! fa('calendar')->lg() !!}
{!! fa('camera')->border() !!}
@fa('star')
@fa('calendar', 'lg')
@fa('camera', 'lg|border')
@fa('hourglass', 'x2|rotate:180')
```
In addition to laravel, you can use it in any PHP project.
```php
// size
echo fa('star')->lg();
echo fa('star')->x2();
echo fa('star')->x3();
echo fa('star')->x4();
echo fa('star')->x5();// fixed with parent
echo fa('star')->fw();// add border
echo fa('star')->border();// add border and pull left
echo fa('star')->border()->left();// add border and pull right
echo fa('star')->border()->right();// spin
echo fa('star')->spin();// pulse
echo fa('star')->spin()->pulse();// rotate
echo fa('star')->rotate(90);
echo fa('star')->rotate(180);
echo fa('star')->rotate(270);// flip
echo fa('star')->flipHorizontal();
echo fa('star')->flipVertical();// stack
echo fa('star')->on(fa('square'));// inverse
echo fa('star')->inverse();// iterat
foreach (fa(['book', 'pencil', 'star', 'gear']) as $fa) {
echo $fa;
}```
To find all icons please refer to [Font Awesome](http://fontawesome.io/icons/)
License
------------
[The MIT License (MIT)](LICENSE).