Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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