[*] CORE : Get instance of current category in category controller

Get instance of category in for eg. module hook using:

$category = $this->context->controller->getCategory()

instead of

new Category(1,1);
This commit is contained in:
Krystian Podemski
2013-08-13 14:52:59 +02:00
parent cba79bdcd6
commit 8051b0021e
+8
View File
@@ -205,5 +205,13 @@ class CategoryControllerCore extends FrontController
$this->context->smarty->assign('nb_products', $this->nbProducts);
}
/**
* Get instance of current category
*/
public function getCategory()
{
return $this->category;
}
}