Hello,
I would like to utilize wire/modules/Inputfield/InputfieldIcon/ in a module.
I found that icons.inc there does not include all FontAwesome 4.4 icon classes.
Is the selection of icon classes in icons.inc opinionated for use in PW or is it just not up to date?
Anyways, I put together some code to produce a icons.inc with all available FA icon classes from master branch, sorted alphabetically:
<?php
$url = "https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/src/icons.yml";
$faArray = yaml_parse_url($url);
// pack all icon ids (classnames) in array and sort alphabetically
$iconClasses = [];
foreach ($faArray['icons'] as $key => $row) {
$iconClasses[$key] = $row['id'];
}
array_multisort($iconClasses, SORT_ASC, $faArray['icons']);
// write all fa classnames to a file
$file = "icons.inc";
$prefix = "fa-";
$out = fopen($file, "w+");
foreach ($iconClasses as $c) {
$class = $prefix . $c . PHP_EOL;
// echo $class . "<br>";
fwrite($out, $class);
}
fclose($out);