user->class === 0)) { return $response->withRedirect('/user'); } $docs = (new Docs())->orderBy('id', 'desc')->get(); return $response->write( $this->view() ->assign('docs', $docs) ->fetch('user/docs/index.tpl') ); } /** * @throws Exception */ public function detail(ServerRequest $request, Response $response, array $args): ResponseInterface { if (! Config::obtain('display_docs') || (Config::obtain('display_docs_only_for_paid_user') && $this->user->class === 0)) { return $response->withRedirect('/user'); } $id = $args['id']; $doc = (new Docs())->find($id); return $response->write( $this->view() ->assign('doc', $doc) ->fetch('user/docs/view.tpl') ); } }