App\Controllers\Admin\OptionsController::index PHP Méthode

index() public méthode

public index ( Psr\Http\Message\ServerRequestInterface $req, $res )
$req Psr\Http\Message\ServerRequestInterface
$res
    public function index(request $req, $res)
    {
        $this->initRoute($req, $res);
        $model = ModelsFactory::getModelWithRequest($req);
        if (!$this->containerSlim->systemOptions->isHideFunctionality() || $this->containerSlim->systemOptions->isDevMode()) {
            $this->data['items'] = $model->paginate($this->pagecount);
        } elseif ($this->containerSlim->systemOptions->isHideFunctionality()) {
            $this->data['items'] = $model->where('frozen', '!=', 1)->orWhere('code', 'develop_mode')->paginate($this->pagecount);
        }
        $this->data['items']->setPath($this->router->pathFor($this->data['all_e_link']));
        $this->data['items']->pagenItems = UrlWindow::make($this->data['items']);
        $t = $model->getColumnsNames(['GroupName']);
        $this->data['fields'] = $this->getFields($t, ['id'], ['values', 'type', 'options_group_id', 'frozen']);
        $userField = ModelsFactory::getModel('UserViewsSettings');
        $userField = $userField->where('user_id', Session::get('user')['id'])->where('group', $this->data['all_e_link'])->where('code', 'show_fields_in_table')->first();
        $this->data['showFields'] = array();
        if ($userField) {
            $this->data['showFields'] = (array) json_decode($userField->toArray()['value']);
            $this->data['fields'] = $this->data['showFields'];
        }
        $this->data['allFields'] = array_diff($model->getColumnsNames(), $this->data['showFields']);
        $this->data['developMode'] = $this->containerSlim->systemOptions->isDevMode();
        $this->render('admin\\optionsTable.twig');
    }
OptionsController