diff --git a/app/Cells/BaseCell.php b/app/Cells/BaseCell.php index 4f323b1..cb28472 100644 --- a/app/Cells/BaseCell.php +++ b/app/Cells/BaseCell.php @@ -3,9 +3,8 @@ namespace App\Cells; use App\Models\CategoryModel; -use CodeIgniter\View\Cells\Cell; -class BaseCell extends Cell +class BaseCell { private $_categoryModel = null; diff --git a/app/Cells/BoardCell.php b/app/Cells/BoardCell.php index 62561f4..a9ce4d8 100644 --- a/app/Cells/BoardCell.php +++ b/app/Cells/BoardCell.php @@ -2,8 +2,9 @@ namespace App\Cells; -use App\Cells\BaseCell; +use App\Models\CategoryModel; use App\Models\BoardModel; +use App\Cells\BaseCell; class BoardCell extends BaseCell { @@ -14,12 +15,16 @@ class BoardCell extends BaseCell } public function information(array $cellDatas = []) { + //dd($cellDatas); helper('Board'); + $cellDatas['currentCategory'] = $this->getCategoryModel()->getEntity([ + 'uid' => __FUNCTION__ + ]); $cellDatas['entitys'] = $this->getBoardModel()->getEntitys([ - 'category' => __FUNCTION__ + 'category' => $cellDatas['currentCategory']->getPrimaryKey() ]); return view( - 'Views/cells/board/' . __FUNCTION__, + 'Views/cells/board/' . $cellDatas['currentCategory']->getPrimaryKey(), ['cellDatas' => $cellDatas] ); }