vhost/app/Cells/BoardCell.php
2024-05-17 23:46:32 +09:00

32 lines
759 B
PHP

<?php
namespace App\Cells;
use App\Models\CategoryModel;
use App\Models\BoardModel;
use App\Cells\BaseCell;
class BoardCell extends BaseCell
{
private $_boardModel = null;
private function getBoardModel(): BoardModel
{
return $this->_boardModel = $this->_boardModel ?: new BoardModel();
}
public function information(array $cellDatas = [])
{
//dd($cellDatas);
helper('Board');
$cellDatas['currentCategory'] = $this->getCategoryModel()->getEntity([
'uid' => __FUNCTION__
]);
$cellDatas['entitys'] = $this->getBoardModel()->getEntitys([
'category' => $cellDatas['currentCategory']->getPrimaryKey()
]);
return view(
'Views/cells/board/' . $cellDatas['currentCategory']->getPrimaryKey(),
['cellDatas' => $cellDatas]
);
}
}