Пример #1
0
 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)]);
     }
 }
Пример #2
0
 public function indexAction()
 {
     $db = new Database(APP_PATH . '/src/config/mysql.ini');
     $this->render('home/index', ['products' => $db->query()]);
 }