protected function findViewMenus($inflection = self::PLURAL)
{
$inflector = StringInflector::getInstance();
$viewFolder = ADMIN_ROOT . '/View';
$views = Filesystem::folders($viewFolder);
$menus = array();
/** @var \SplFileInfo $view */
foreach ($views as $view) {
if ($view->isFile()) {
continue;
}
$name = strtolower($view->getBasename());
if ($inflection == static::PLURAL && $inflector->isPlural($name)) {
$menus[] = $name;
} elseif ($inflection == static::SINGULAR && $inflector->isSingular($name)) {
$menus[] = $name;
}
}
return $menus;
}