Created
August 6, 2013 20:36
-
-
Save SofHad/6168362 to your computer and use it in GitHub Desktop.
initialize Symfony Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function initializeAction() { | |
$this->doctrine = $this->getDoctrine(); | |
$this->bundle = $this->container->getParameter("bundle"); | |
$this->entityManager = $this->doctrine->getEntityManager(); | |
$this->productRepository = $this->doctrine->getRepository($this->bundle . ':Product'); | |
$this->categoryRepository = $this->doctrine->getRepository($this->bundle . ':Category'); | |
$this->categoryModel = $categoryModel = $this->get("CategoryModel"); | |
$this->productModel = $this->get("ProductModel"); | |
//Menu | |
$this->menu["menu"] = $this->get("menu"); | |
$this->menu["main_menu"] = $this->container->getParameter('menu')["main_menu"]; | |
$this->menu["active_menu"] = $this->container->getParameter("active_menu"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment