drahak / Restful

Drahak\Restful - Nette REST API bundle
0 stars 0 forks source link

Create automatic routes manually in RouterFactory #128

Open tprochazka opened 7 years ago

tprochazka commented 7 years ago

If I'm using routes defined in the neon config file everything is OK. I can choose order of routers created by this extension automatically. But If I want to use RouterFactory defined as router: App\RouterFactory::createRouter it is not possible to change the order and routes created by this extension are always first. I know that there is possibility to create all routes manually by ResourceRoute, but I would like to keep the smart annotation way.

Sou would be great if would be possible to create all of them automatically in the RouterFactory at the place when I exactly need like:

    public static function createRouter() {
        $router = new RouteList;
        $router[] = ...
        $router[] = new AutomaticResftullRoute(); 
        $router[] = ...
        $router[] = new Route('<presenter>/<action>[/<id>]', 'Dashboard:default');
        return $router;
    }