dmnkhhn
Active member
Hello there!
I am rebuilding some of my addons and right now I am unsure what to do with all the actions I need.
My first add-on is going to be some sort of garage where my members can show their cars.
Here's the url structure I would like to use
/garage => index (list of garages)
/garage/2 => details for garage with id of 2
/garage/2/car/1 => details for a car with id of 1 parked in garage with id of 2
And (for admins and the owner of the garage)
/garage/2/edit
/garage/2/car/1/edit
I am already using
in the router so /garage and garage/2 and even garage/2/edit are working fine (the latter just calls actionEdit inside my controller).
Now when I type /garage/2/car/1 into my browser I get:
How do I get the last part of the Url (the car thing) working?
Is it even possible or do I need to create a new route (like garage-car/2/edit)?
I am rebuilding some of my addons and right now I am unsure what to do with all the actions I need.
My first add-on is going to be some sort of garage where my members can show their cars.
Here's the url structure I would like to use
/garage => index (list of garages)
/garage/2 => details for garage with id of 2
/garage/2/car/1 => details for a car with id of 1 parked in garage with id of 2
And (for admins and the owner of the garage)
/garage/2/edit
/garage/2/car/1/edit
I am already using
PHP:
$action = $router->resolveActionWithIntegerParam($routePath, $request, 'garage_id');
Now when I type /garage/2/car/1 into my browser I get:
The controller Garage_ControllerPublic_Index does not define an action called Car1.
How do I get the last part of the Url (the car thing) working?
Is it even possible or do I need to create a new route (like garage-car/2/edit)?