32 lines
759 B
PHP
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]
|
|
);
|
|
}
|
|
}
|