ptejada / f3-hmvc

13 stars 7 forks source link

default route for another controllers #8

Open amidia opened 8 years ago

amidia commented 8 years ago

Can we make default index route for another controller in one modules?

Authenicate/ ` ` ` `/controllers/ ` ` ` ` ` ` ` `Authenticate.php ` ` ` ` ` ` ` ` ` ` ` ` ` -> index() ` ` ` ` ` ` ` ` ` ` ` ` `-> authenticate() ` ` ` ` ` ` ` ` ` ` ` ` ` ->login() ` ` ` ` ` ` ` ` ` ` ` ` `->logout() ` ` ` ` ` ` ` `Landing.php ` ` ` ` ` ` ` ` ` ` ` ` ` ->index() ` ` ` ` ` ` ` ` ` ` ` ` ` ->read()

my config.ini [routes] GET /@module/@controller/@action = @module\controllers\@controller->@action GET /@module/@action = @module\controllers\@module->@action GET /@module = @module\controllers\@module->index

it's can be done by uri example.com/Authenticate/Landing/index and example.com/Authenticate/Landing/read

but it feels not clean for index function. if i add GET /@module/@controller = @module\controllers\@controller->index in route it's messed up with this route GET /@module/@action = @module\controllers\@module->@action

so how can we make the route for uri example.com/Authenticate/Landing (which calling index()) any direction for this case?

ptejada commented 8 years ago

There are too many varibles in the routes. Keep it simple and add a static route for this case