public function resolve(IRequest $request) { if ($request->hasGetParameter('action')) { return $this->createActionByName($request->getGetParameter('action')); } return $this->createDefaultAction(); }
public function process(IRequest $request) { if (!$request->hasGetParameter('post_id')) { $this->getRenderer()->render('404', new NullResponse()); return; } $this->getRenderer()->render('post', new Response($this->getDaoFactory()->getPostDao()->getById($request->getGetParameter('post_id')), $this->getDaoFactory()->getPostCommentDao()->getListByPostId($request->getGetParameter('post_id')))); }
public function process(IRequest $request) { if ($request->isPosted()) { $form = (new AuthorizationForm())->import($request->getPostParameters()); if ($form->isValid()) { $this->authorize($form); $this->getRenderer()->render('index', new RedirectResponse('index')); } } $this->getRenderer()->render('authorization', new NullResponse()); }
public function process(IRequest $request) { if ($request->isPosted()) { $form = (new AddCommentForm())->import($request->getPostParameters()); if ($form->isValid()) { try { $this->addComment($form); } catch (Exception $e) { echo 'Bad SQL request'; } $this->getRenderer()->render('viewPost', new RedirectResponse('viewPost', array('post_id' => $form->getPostId()))); } } $this->getRenderer()->render('404', new NullResponse()); }
public function process(IRequest $request) { if ($request->isPosted()) { $form = (new AddPostForm())->import($request->getPostParameters()); if ($form->isValid()) { try { $this->addPost($form); } catch (Exception $e) { echo 'Bad SQL request'; } $this->getRenderer()->render('index', new RedirectResponse('index')); } } $this->getRenderer()->render('addPost', new NullResponse()); }