本文整理汇总了PHP中SS_HTTPResponse::getVar方法的典型用法代码示例。如果您正苦于以下问题:PHP SS_HTTPResponse::getVar方法的具体用法?PHP SS_HTTPResponse::getVar怎么用?PHP SS_HTTPResponse::getVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SS_HTTPResponse
的用法示例。
在下文中一共展示了SS_HTTPResponse::getVar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleCategoryChangeRequest
public function handleCategoryChangeRequest(SS_HTTPResponse $r)
{
if (!Member::currentUser()) {
return $this->httpError(403);
}
if (!is_numeric($r->getVar('new_cat'))) {
return $this->httpError(500, "Invalid category id");
}
$c = PresentationCategory::get()->byID((int) $r->getVar('new_cat'));
if ($c) {
$request = new SummitCategoryChange();
$request->PresentationID = $this->presentation->ID;
$request->NewCategoryID = $r->getVar('new_cat');
$request->ReqesterID = Member::currentUserID();
$request->write();
$m = Member::currentUser();
$comment = $m->FirstName . ' ' . $m->Surname . ' suggested that this presentation be moved to the category ' . $c->Title . '.';
$this->presentation->addComment($comment, Member::currentUserID());
return new SS_HTTPResponse("change request made.", 200);
}
}
示例2: handleSelect
/**
* @param SS_HTTPResponse $r
* @throws SS_HTTPResponse_Exception
*/
public function handleSelect(SS_HTTPResponse $r)
{
if (!Member::currentUser()) {
return $this->httpError(403);
}
try {
$maybe = SummitSelectedPresentation::COLLECTION_MAYBE;
$pass = SummitSelectedPresentation::COLLECTION_PASS;
$selected = SummitSelectedPresentation::COLLECTION_SELECTED;
switch ($r->getVar('type')) {
case $maybe:
$this->presentation->assignToIndividualList($maybe);
break;
case $pass:
$this->presentation->assignToIndividualList($pass);
break;
default:
$this->presentation->assignToIndividualList($selected);
break;
}
return new SS_HTTPResponse('OK');
} catch (EntityValidationException $ex1) {
SS_Log::log($ex1->getMessage(), SS_Log::WARN);
return $this->validationError($ex1->getMessages());
} catch (Exception $ex) {
SS_Log::log($ex->getMessage(), SS_Log::ERR);
return $this->serverError();
}
}