PHP code example of hailwood / silverstripe-fontawesome
1. Go to this page and download the library: Download hailwood/silverstripe-fontawesome library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hailwood / silverstripe-fontawesome example snippets
class PageWithIcon extends Page {
protected static $db = [
'PageIcon' => 'FontAwesomeIcon',
];
public function getCMSFields(){
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', FontAwesomeIconField::create('PageIcon', 'Icon'));
return $fields;
}
}