-
Notifications
You must be signed in to change notification settings - Fork 11k
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
URL generation for named resource controller #182
Comments
OK, so the To reach a standard named route I need: To reach a resource controller named route I need: Is that the way it was meant to work? Has |
Yes, {id} has been dropped. However, I should point out, you don't have to specify keys at all:
will work fine...
|
Is the dropping of keys for all routes, or only those created via resource controllers? |
…tional-info Finished back-end work for this branch. Todo: match with front-end
In my routes.php I have a resourceful route / controller:
Route::resource('manager', 'Battrick\Manager', ['only' => ['index', 'show', 'create']]);
In my Home.php controller, I insert a HTML link, with a named resourceful route, with:
\URL::route('manager.show', array('id' => '11287'))
for the href as I want to link to a particular Manager.However, when calling the home page, I get the following error:
MissingMandatoryParametersException: Some mandatory parameters are missing ("manager") to generate a URL for route "manager.show".
(my emphasis)
I've tried digging down into the Symfony Routing files, but couldn't quite follow why the
array('manager')
(highlighted) was getting set as the first argument ofdoGenerate()
, which then gets used as a check against which parameters were passed (here, just thearray('id' => '11287')
as I believe it should be), and therefore failing.Is this a Symfony issue (if so, could someone who can explain it better please pass it upstream), is it some issue with the choice of naming format for named routes for resource controllers in L4, or am I doing something wrong?
The text was updated successfully, but these errors were encountered: