So im trying to get the id from url which look like this "catalog/category/edit/key/3fe130e5c0d9110729ff37ef34801a53362cca59c5b2ce91c0bffc59bf699b51/id/147/"

I want to know if that is possible? I have almost tried everything from google. Nothing works!

$id = $this->getRequest()->getParam('id');

In controllers and blocks you have direct access to the request object. Try this code

$data = $this->getRequest()->getParams();
$categoryid = $data['id'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.