Now before you ask: why I have the route in there twice, this is because the route builder refuses to give the appropriate route if I wanted to call it without a release (as the :release variable is defined in the JavaScript on the page).
So now my question is: how can I make these “partial” named routes work?
All I really care about is the api:v1 part.
Why do you want to complicate the code, isn’t life complicated enough?
Should hit you hard
Regarding your question, I am not sure if hierarchicalroutes is possible.
But you can definately break it down into plugins and then do your thing.
Sounds easy?
I would suggest breaking the app down into plugins. As opposed to Zend Framework. CakePHP has a Hierarchical system but the workaround is via plugins…
Just enable bootstrap and routes in your plugin and it will be able to accomplish the nested routes!
Well… considering it’s my own website, I think I have plenty of budget for it XD
Hmm… I was afraid I had to do this yes… I’ll open an issue on the CakePHP repo to see if maybe they could add something that prevents these cases (because I doubt that I’m the only one that ever has ran into this).
Thanks anyways, I’ll have a closer look into it.
i think it should work IIRC you just lose ability to use ->setPattern this could be annoying if you tried to pass 2 params in one url segment ie /:id-:slug but should still work if you give multiple arguments
public function editRelease($arg1 = null, $arg2 = null) {
}
The trailing /* tells the router to pass any additional segments as method arguments. For example, /users/view/123 would map to UsersController->view(123)
Hmm… I see.
Well, considering the app requires specific params at specific places anyways that isn’t too much of an issue.
I’ll have a go at it when I’m home again