Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set routes in a 'latter overwrite' manner #524

Open
lenton opened this issue Jul 29, 2014 · 5 comments
Open

Set routes in a 'latter overwrite' manner #524

lenton opened this issue Jul 29, 2014 · 5 comments
Milestone

Comments

@lenton
Copy link
Contributor

lenton commented Jul 29, 2014

I propose that routes be set in a 'later routes overwrite' manner instead of the current 'first come, first serve'.

It's a problem for two reasons:

  • It's not logically intuitive to programmers, we are used to later defined things overwriting.
  • It forces modules to be loaded in the wrong (reverse) order.

When modules can be loaded in the correct order, later initialisation files (such as in application) can manipulate objects created by previous initialisation files.

@lenton lenton changed the title Module init files are loaded in reverse order Modules are loaded in reverse order Aug 6, 2014
@lenton lenton changed the title Modules are loaded in reverse order Modules are initialised in reverse order Aug 13, 2014
@enov
Copy link
Contributor

enov commented Aug 13, 2014

maybe separate Routes into routes.php and have them loaded top to bottom?

@lenton
Copy link
Contributor Author

lenton commented Aug 13, 2014

@enov That would still mean you can't interact with routes which have been set in a lower module and it would break all existing modules which use routes.

@enov
Copy link
Contributor

enov commented Aug 13, 2014

You mean we can't interact with routes from init.php?

@lenton
Copy link
Contributor Author

lenton commented Aug 13, 2014

Nope, from a route.php which is in a higher module.

I think it's best to fix this one at the source of the problem.

@enov enov added this to the 3.4.0 milestone Nov 26, 2014
@lenton lenton changed the title Modules are initialised in reverse order Set routes in a 'latter overwrite' manner instead of 'first come, first serve Jan 21, 2015
@lenton lenton changed the title Set routes in a 'latter overwrite' manner instead of 'first come, first serve Set routes in a 'latter overwrite' manner instead of 'first come, first serve' Jan 21, 2015
@lenton lenton changed the title Set routes in a 'latter overwrite' manner instead of 'first come, first serve' Set routes in a 'latter overwrite' manner Jan 21, 2015
@lenton lenton modified the milestones: 4.0.0, 3.4.0 Jan 21, 2015
@acoulton
Copy link
Member

Just to be clear, are you proposing that as well as making Route::set overwrite a previously defined route with the same name, we also reverse the sequence of calling each module's init.php?

@enov enov mentioned this issue Jan 15, 2016
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants