Is there a Magento function to get the value of \"id\" from this url:
http://example.com/path/action/id/123
I know I can split the url on \"/\" to get the va
Magento's default routing algorithm uses three part URLs.
http://example.com/front-name/controller-name/action-method
So when you call
http://example.com/path/action/id/123
The word path
is your front name, action
is your controller name, and id
is your action method. After these three methods, you can use getParam
to grab a key/value pair
http://example.com/path/action/id/foo/123
//in a controller
var_dump($this->getRequest()->getParam('foo'));
You may also use the getParams
method to grab an array of parameters
$this->getRequest()->getParams()