public static function getControllers(bool $includePlugins = true): array
    {
        // get application controllers
        $result = static::getDirControllers(APP . 'Controller' . DS);

        if ($includePlugins === false) {
            return $result;
        }

        $plugins = Plugin::loaded();
        if (!is_array($plugins)) {
            return $result;
        }

        // get plugins controllers
        foreach ($plugins as $plugin) {
            $path = Plugin::path($plugin) . 'src' . DS . 'Controller' . DS;
            $result = array_merge($result, static::getDirControllers($path, $plugin));
        }

        return $result;
    }
public static function getControllers(bool $includePlugins = true): array
    {
        // get application controllers
        $result = static::getDirControllers(APP . 'Controller' . DS);

        if ($includePlugins === false) {
            return $result;
        }

        $plugins = Plugin::loaded();
        if (!is_array($plugins)) {
            return $result;
        }

        // get plugins controllers
        foreach ($plugins as $plugin) {
            $path = Plugin::path($plugin) . 'src' . DS . 'Controller' . DS;
            $result = array_merge($result, static::getDirControllers($path, $plugin));
        }

        return $result;
    }
public static function getControllers ( bool $ includePlugins = true ) : array { // get application controllers $ result = static :: getDirControllers ( APP . 'Controller' . DS ) ; if ( $ includePlugins === false ) { return $ result ; } $ plugins = Plugin :: loaded ( ) ; if ( ! is_array ( $ plugins ) ) { return $ result ; } // get plugins controllers foreach ( $ plugins as $ plugin ) { $ path = Plugin :: path ( $ plugin ) . 'src' . DS . 'Controller' . DS ; $ result = array_merge ( $ result , static :: getDirControllers ( $ path , $ plugin ) ) ; } return $ result ; }
Method that returns all controller names.

@param bool $includePlugins Flag for including plugin controllers
@return mixed[]
Method that returns all controller names .