flame-org / Modules

Nette modules on the Steroids
http://flame-org.github.io/Modules/
GNU Lesser General Public License v3.0
13 stars 7 forks source link

Add Route priority #28

Open marten-cz opened 8 years ago

marten-cz commented 8 years ago

It will be nice to be able to define priority of the routes. When using more extensions or extension with Nette's RouterFactory, I'll need to be able to define priority. Now it will add the router from module at the end. Not sure how to define or where it will had to be implemented.

Extension1:

/**
 * @priority 2
 */
public function getRoutesDefinition() { ..... }

Extension2:

/**
 * @priority 1
 */
public function getRoutesDefinition() { ..... }

Even if extension2 is initialized after extension1, it will add the router before router from extension2, because it has higher priority.

Would that be possible or right now this is limitation in Nette?

jsifalda commented 8 years ago

Hey, thanks for your comment. Definitelly, flame/modules would love to have something like this! What about to just extend configuration of routes rather than adding whole logic about parsing @docs, hm? :)