Update readme.md

This commit is contained in:
Tony Air 2018-06-24 16:57:15 +07:00 committed by GitHub
parent f990fbd448
commit bb167028f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,16 +2,18 @@
Provides a field to easily pick font-awesome icons Provides a field to easily pick font-awesome icons
## Features ## Features
* Easily pick icons to be used anywhere in the frontend * Easily pick icons to be used anywhere in the backend
* Can filter on icon name * Can filter on icon name
## Requirements
SilverStripe 4+
## Installation ## Installation
### Composer ### Composer
Make sure you're not double loading the css/fonts with a theme.
Ideally composer will be used to install this module. Ideally composer will be used to install this module.
```composer require "moe/font-awesome:@stable"``` ```composer require "a2nt/silverstripe-font-awesome:@dev-master"```
## Screen shots ## Screen shots
@ -25,6 +27,9 @@ Ideally composer will be used to install this module.
A basic working example, and the following to any class you want the field on; A basic working example, and the following to any class you want the field on;
```php ```php
use SilverStripe\FontAwesome\FontAwesomeField;
class Blabla extends ... {
private static $db = array( private static $db = array(
'Icon' => 'Varchar(255)', 'Icon' => 'Varchar(255)',
); );
@ -39,6 +44,7 @@ A basic working example, and the following to any class you want the field on;
return $fields; return $fields;
} }
}
``` ```
Then simple include in the template where you want the icon placed Then simple include in the template where you want the icon placed
@ -52,4 +58,4 @@ The controller extension should make sure you've got access to the icons so you
Got you covered, checkout [color-swabs](https://github.com/peavers/silverstripe-color-swabs)! Got you covered, checkout [color-swabs](https://github.com/peavers/silverstripe-color-swabs)!
## Libraries used/modified ## Libraries used/modified
* Font Awesome 4.7 * Font Awesome > 5