public function loadRoutesFromPath($fromPath, $namespace = '', $hooks=[])
    {
        $dir = @dir($fromPath) or abort("dir $fromPath not exist");

        $getEach = function () use ($dir) {
            $name = $dir->read();
            if (!$name) {
                return $name;
            }
            return $name;
        };

        while (!!($entry = $getEach())) {
            if ($entry == '.' || $entry == '..') {
                continue;
            }
            $path = $fromPath . '/' . str_replace('\\', '/', $entry);
            if (is_file($path) && substr_compare($entry, '.php', strlen($entry) - 4, 4, true) == 0) {
                $class_name = $namespace . '\\' . substr($entry, 0, strlen($entry) - 4);
                $this->loadRoutesFromClass($class_name, $hooks);
            } else {
                //\Log::debug($path.' ignored');
            }
        }
    }