public function WeMegaMenuAdminController::getIcons in Drupal Mega Menu 8.x
Same name and namespace in other branches
- 8 src/Controller/WeMegaMenuAdminController.php \Drupal\we_megamenu\Controller\WeMegaMenuAdminController::getIcons()
Render list icon font awesome.
1 string reference to 'WeMegaMenuAdminController::getIcons'
File
- src/
Controller/ WeMegaMenuAdminController.php, line 200
Class
- WeMegaMenuAdminController
- Controller routines for block example routes.
Namespace
Drupal\we_megamenu\ControllerCode
public function getIcons() {
$file = DRUPAL_ROOT . '/' . $this->moduleHandler
->getModule('we_megamenu')
->getPath() . '/assets/resources/icon.wemegamenu';
$fh = fopen($file, 'r');
$result = [];
while ($line = fgets($fh)) {
$result[] = trim($line);
}
fclose($fh);
echo json_encode($result);
exit;
}