public function getAvailableControllersAction()
{
$controllers = [];
$controllerDir = $this->getControllerDir();
$controllerFiles = rscandir($controllerDir);
foreach ($controllerFiles as $file) {
$file = str_replace($controllerDir, "", $file);
$dat = [];
if (strpos($file, ".php") !== false) {
$file = lcfirst(str_replace("Controller.php", "", $file));
$file = strtolower(preg_replace("/[A-Z]/", "-\\0", $file));
$dat["name"] = str_replace("/-", "_", $file);
$controllers[] = $dat;
}
}
$this->_helper->json(["data" => $controllers]);
}