silverstripe-font-awesome/code/formfields/FontAwesomeField.php
2015-05-09 12:31:32 +12:00

21 lines
611 B
PHP

<?php
/**
* Class FontAwesomeField
*/
class FontAwesomeField extends DropdownField
{
public function Type()
{
return 'dropdown';
}
public function __construct($name, $title = null, $source = array(), $value = '', $form = null, $emptyString = null)
{
parent::__construct($name, $title, $source, $value, $form, $emptyString);
$this->setSource(FontAwesome::getIcons());
$this->setTitle("Font Awesome icon");
$this->setDescription('<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">List of icons available here</a>');
}
}