示例#1
0
文件: Product.php 项目: ehime/Target
 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
文件: Index.php 项目: ehime/Target
 public function indexAction()
 {
     $db = new Database(APP_PATH . '/src/config/mysql.ini');
     $this->render('home/index', ['products' => $db->query()]);
 }