本文整理汇总了PHP中HTTPRequest::getExists方法的典型用法代码示例。如果您正苦于以下问题:PHP HTTPRequest::getExists方法的具体用法?PHP HTTPRequest::getExists怎么用?PHP HTTPRequest::getExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTPRequest
的用法示例。
在下文中一共展示了HTTPRequest::getExists方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($path = NULL)
{
$this->FS = new FS();
$this->httpResponse = new HTTPResponse();
$this->httpRequest = new HTTPRequest();
$this->path = isset($path) ? $path : ($this->httpRequest->getExists('path') ? $this->httpRequest->getData('path') : NULL);
}
示例2: executeLeave
public function executeLeave(HTTPRequest $request)
{
$this->authenticationRedirection();
if (!$request->getExists('feedbackRequestId')) {
$this->app->httpResponse()->redirect404();
exit;
}
$feedbackRequestId = htmlspecialchars($request->getData('feedbackRequestId'));
$feedbackRequest = $this->_feedbackRequestsManager->get($feedbackRequestId);
if (is_null($feedbackRequest)) {
$this->app->httpResponse()->redirect404();
exit;
}
if ($request->postExists('submit-form')) {
$feedback = new Feedback();
$feedback->setAnnounceId($feedbackRequest->getAnnounceId());
$feedback->setUserAuthorId($feedbackRequest->getUserAuthorId());
$feedback->setUserOwnerId($feedbackRequest->getUserOwnerId());
$feedback->setUserSubscriberId($feedbackRequest->getUserSubscriberId());
$feedback->setReservationId($feedbackRequest->getReservationId());
$mark = htmlspecialchars($request->postData('mark'));
$comment = htmlspecialchars($request->postData('comment'));
$feedback->setMark($mark);
$feedback->setComment($comment);
$this->_feedbacksManager->save($feedback);
$this->_feedbackRequestsManager->delete($feedbackRequest->id());
$this->app->user()->setFlash('feedback-saved');
$this->app->httpResponse()->redirect('/feedback');
exit;
}
$this->page->smarty()->assign('feedbackRequest', $feedbackRequest);
}
示例3: executeIndex
public function executeIndex(HTTPRequest $request)
{
$announces = $this->_announcementsManager->getListOf($this->_user->id());
$this->page->smarty()->assign('announces', $announces);
$this->page->smarty()->assign('categoriesManager', $this->_categoriesManager);
$this->_pageState = 'drafts';
if ($request->getExists('state')) {
switch ($request->getData('state')) {
case 'drafts':
$this->_pageState = 'drafts';
break;
case 'validated':
$this->_pageState = 'validated';
break;
case 'archived':
$this->_pageState = 'archived';
break;
case 'pending':
$this->_pageState = 'pending';
break;
case 'refused':
$this->_pageState = 'refused';
break;
default:
break;
}
}
$this->page->smarty()->assign('state', $this->_pageState);
}
示例4: executeIndex
public function executeIndex(HTTPRequest $request)
{
if ($request->getExists('contactGroup')) {
$contactGroup = $request->getData('contactGroup');
$this->page->smarty()->assign('contactGroup', $contactGroup);
}
$contacts = $this->_contactsManager->getListOf($this->_user->id());
$this->page->smarty()->assign('contacts', $contacts);
$contactRequests = $this->_contactRequestsManager->getListOfTo($this->_user->id());
$this->page->smarty()->assign('contactRequests', $contactRequests);
$this->page->smarty()->assign('profilesManager', $this->_profilesManager);
$this->page->smarty()->assign('usersManager', $this->_usersManager);
$this->page->smarty()->assign('addressesManager', $this->_addressesManager);
}
示例5: executeIndex
public function executeIndex(HTTPRequest $request)
{
if ($request->getExists('contactGroup')) {
$contactGroup = $request->getData('contactGroup');
$this->page->smarty()->assign('contactGroup', $contactGroup);
}
$contacts = $this->_contactsManager->getListOf($this->_user->id());
$this->page->smarty()->assign('contacts', $contacts);
$contactRequests = $this->_contactRequestsManager->getListOfTo($this->_user->id());
$this->page->smarty()->assign('contactRequests', $contactRequests);
$this->page->smarty()->assign('profilesManager', $this->_profilesManager);
$this->page->smarty()->assign('usersManager', $this->_usersManager);
$this->page->smarty()->assign('addressesManager', $this->_addressesManager);
if (@$_POST['commentaire']) {
$this->page->smarty()->assign('commentaire', $_POST['commentaire']);
} else {
$this->page->smarty()->assign('commentaire', '');
}
if (@$_POST['emails_liste']) {
$this->page->smarty()->assign('emails_liste', $_POST['commentaire']);
} else {
$this->page->smarty()->assign('emails_liste', '');
}
}
示例6: reservationRedirect
private function reservationRedirect(HTTPRequest $request)
{
if ($request->getExists('reservationId') && $request->getExists('keyCheck')) {
$idReservation = htmlspecialchars($request->getData('reservationId'));
$reservation = $this->_announcementReservationManager->get($idReservation);
//Si notre lien de réservation a déjà été "consommé" on redirige vers une page de "Rebond"
if (is_null($reservation->getKeyCheck())) {
$this->app->httpResponse()->redirect('/reservations/rebound/' . $reservation->id());
exit;
} elseif ($reservation->getKeyCheck() != $request->getData('keyCheck')) {
$this->app->httpResponse()->redirect404();
exit;
}
} else {
$this->app->httpResponse()->redirect404();
exit;
}
}
示例7: executeUsernameExists
public function executeUsernameExists(HTTPRequest $request)
{
$this->init();
if ($request->getExists('username')) {
$username = htmlspecialchars($request->getData('username'));
$isUsernameExists = $this->_userManager->isUsernameOrMailExist($username, $username);
$this->page->smarty()->assign('usernameExists', $isUsernameExists);
} else {
$this->app->httpResponse()->redirect404();
exit;
}
}