Magento 2 Registry – Get Current Category ID

categorymagento2registry

Any one know how I can get the category id using current category registry in Magento 2?

Best Answer

I think You have done in your controller maybe you should get the object manager to be initialized by the use of context class in the __construct method.