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\CategoryModel; |
9
|
|
|
use Jidaikobo\Kontiki\Services\RoutesService; |
10
|
|
|
use Jidaikobo\Kontiki\Services\FormService; |
11
|
|
|
use Jidaikobo\Kontiki\Services\TableService; |
12
|
|
|
|
13
|
|
|
class CategoryController extends BaseController |
14
|
|
|
{ |
15
|
|
|
// use Traits\IndexTrait; |
16
|
|
|
// use Traits\IndexTaxonomyTrait; |
17
|
|
|
// use Traits\CreateEditTrait; |
18
|
|
|
// use Traits\DeleteTrait; |
19
|
|
|
|
20
|
|
|
protected string $adminDirName = 'post/category'; |
21
|
|
|
protected string $label = 'Post/Category'; |
22
|
|
|
protected CategoryModel $model; |
23
|
|
|
|
24
|
|
|
private FormService $formService; |
25
|
|
|
private TableService $tableService; |
26
|
|
|
|
27
|
|
|
public function __construct( |
28
|
|
|
CsrfManager $csrfManager, |
29
|
|
|
FlashManager $flashManager, |
30
|
|
|
PhpRenderer $view, |
31
|
|
|
RoutesService $routesService, |
32
|
|
|
FormService $formService, |
33
|
|
|
TableService $tableService, |
34
|
|
|
CategoryModel $model |
35
|
|
|
) { |
36
|
|
|
parent::__construct( |
37
|
|
|
$csrfManager, |
38
|
|
|
$flashManager, |
39
|
|
|
$view, |
40
|
|
|
$routesService |
41
|
|
|
); |
42
|
|
|
$this->formService = $formService; |
43
|
|
|
$this->formService->setModel($model); |
44
|
|
|
$this->tableService = $tableService; |
45
|
|
|
$this->tableService->setModel($model); |
46
|
|
|
$this->model = $model; |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|