jidaikobo-shibata /
kontiki-framework
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Jidaikobo\Kontiki\Controllers; |
||
| 4 | |||
| 5 | use Slim\Views\PhpRenderer; |
||
| 6 | use Jidaikobo\Kontiki\Managers\CsrfManager; |
||
| 7 | use Jidaikobo\Kontiki\Managers\FlashManager; |
||
| 8 | use Jidaikobo\Kontiki\Models\PostModel; |
||
| 9 | use Jidaikobo\Kontiki\Services\RoutesService; |
||
| 10 | use Jidaikobo\Kontiki\Services\FormService; |
||
| 11 | use Jidaikobo\Kontiki\Services\TableService; |
||
| 12 | |||
| 13 | class PostController extends BaseController |
||
| 14 | { |
||
| 15 | use Traits\IndexTrait; |
||
| 16 | use Traits\IndexAllTrait; |
||
| 17 | use Traits\IndexPublishedTrait; |
||
| 18 | use Traits\IndexPendingTrait; |
||
| 19 | use Traits\IndexDraftTrait; |
||
| 20 | use Traits\IndexReservedTrait; |
||
| 21 | use Traits\IndexExpiredTrait; |
||
| 22 | use Traits\CreateEditTrait; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 23 | use Traits\TrashRestoreTrait; |
||
| 24 | use Traits\DeleteTrait; |
||
| 25 | use Traits\PreviewTrait; |
||
| 26 | |||
| 27 | protected string $adminDirName = 'post'; |
||
| 28 | protected string $label = 'Post'; |
||
| 29 | |||
| 30 | private PostModel $model; |
||
| 31 | private FormService $formService; |
||
| 32 | private TableService $tableService; |
||
| 33 | |||
| 34 | public function __construct( |
||
| 35 | CsrfManager $csrfManager, |
||
| 36 | FlashManager $flashManager, |
||
| 37 | PhpRenderer $view, |
||
| 38 | RoutesService $routesService, |
||
| 39 | FormService $formService, |
||
| 40 | TableService $tableService, |
||
| 41 | PostModel $model |
||
| 42 | ) { |
||
| 43 | parent::__construct( |
||
| 44 | $csrfManager, |
||
| 45 | $flashManager, |
||
| 46 | $view, |
||
| 47 | $routesService |
||
| 48 | ); |
||
| 49 | $this->formService = $formService; |
||
| 50 | $this->formService->setModel($model); |
||
| 51 | $this->tableService = $tableService; |
||
| 52 | $this->tableService->setModel($model); |
||
| 53 | $this->model = $model; |
||
| 54 | } |
||
| 55 | |||
| 56 | protected function setViewAttributes($routesService): void |
||
| 57 | { |
||
| 58 | parent::setViewAttributes($routesService); |
||
| 59 | $this->view->addAttribute('buttonPosition', 'meta'); |
||
| 60 | } |
||
| 61 | } |
||
| 62 |