public function index($init, $id = null) { if ($init == 'admin') { parent::routes()->render('index_product.twig', array('app_base' => $this->appBase, 'product_page' => Product::ProductPage($id), 'results' => Product::ProductPagination($id), 'title' => 'Products')); } else { parent::routes()->render('index_home.twig', array('app_base' => $this->appBase, 'carousels' => Carousel::indexCarousel(), 'carts' => Cart::countCart(), 'is_carousel' => Carousel::countCarousel(), 'is_customer' => isset($_SESSION['emailCustomer']) ? sizeof($_SESSION['emailCustomer']) : 0, 'product_page' => Product::ProductPage($id, 'customer'), 'results' => Product::ProductPagination($id), 'title' => 'Home')); } }