public function editAction($id = false) { $db = new Database(APP_PATH . '/src/config/mysql.ini'); if (false !== $id) { $this->render('product/edit', ['product' => $db->query()]); } else { $this->render('product/edit', ['product' => $db->get($id)]); } }
public function indexAction() { $db = new Database(APP_PATH . '/src/config/mysql.ini'); $this->render('home/index', ['products' => $db->query()]); }