当前位置: 首页>>代码示例>>PHP>>正文


PHP SS_HTTPResponse::getVar方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:21,代码来源:TrackChairAPI.php

示例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();
     }
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:33,代码来源:TrackChairAPI.php


注:本文中的SS_HTTPResponse::getVar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。