This commit is contained in:
Danni committed 2026-09-20 13:07:50 +07:00
1 parent 620fc5bda1
commit bd3ef9f279
779 files changed
+202868

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
<?php
namespace App\Controllers;
use App\Models\ItemModel;
use CodeIgniter\Exceptions\PageNotFoundException;
class Item extends BaseController {
public function index() {
$model = model(ItemModel::class);
$data = [
'title' => 'Emperiko Shop',
'item' => $model->paginate(6),
'pager' => $model->pager,
];
return view('Item/index', $data);
}
public function show(?string $itemId = null) {
$model = model(ItemModel::class);
$data['item'] = $model->getItem($itemId);
$data['star'] = $model->getStar($itemId);
if ($data['item'] === null) {
throw new PageNotFoundException('Cannot find requested product ID number: ' . $itemId);
}
$data['title'] = $data['item']['title'];
helper('form');
helper('cookie');
return view('Item/product', $data);
}
public function set() {
$cookie = new Cookie( [
'expires' => new DateTime('+2 days'),
'prefix' => '__Secure-',
'path' => '/',
'domain' => '',
] );
}
}