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


PHP AphrontRequest::setCookie方法代码示例

本文整理汇总了PHP中AphrontRequest::setCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP AphrontRequest::setCookie方法的具体用法?PHP AphrontRequest::setCookie怎么用?PHP AphrontRequest::setCookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AphrontRequest的用法示例。


在下文中一共展示了AphrontRequest::setCookie方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $viewer = $this->getViewer();
     $engine = id(new PhabricatorAuthInviteEngine())->setViewer($viewer);
     if ($request->isFormPost()) {
         $engine->setUserHasConfirmedVerify(true);
     }
     $invite_code = $request->getURIData('code');
     try {
         $invite = $engine->processInviteCode($invite_code);
     } catch (PhabricatorAuthInviteDialogException $ex) {
         $response = $this->newDialog()->setTitle($ex->getTitle())->appendParagraph($ex->getBody());
         $submit_text = $ex->getSubmitButtonText();
         if ($submit_text) {
             $response->addSubmitButton($submit_text);
         }
         $submit_uri = $ex->getSubmitButtonURI();
         if ($submit_uri) {
             $response->setSubmitURI($submit_uri);
         }
         $cancel_uri = $ex->getCancelButtonURI();
         $cancel_text = $ex->getCancelButtonText();
         if ($cancel_uri && $cancel_text) {
             $response->addCancelButton($cancel_uri, $cancel_text);
         } else {
             if ($cancel_uri) {
                 $response->addCancelButton($cancel_uri);
             }
         }
         return $response;
     } catch (PhabricatorAuthInviteRegisteredException $ex) {
         // We're all set on processing this invite, just send the user home.
         return id(new AphrontRedirectResponse())->setURI('/');
     }
     // Give the user a cookie with the invite code and send them through
     // normal registration. We'll adjust the flow there.
     $request->setCookie(PhabricatorCookies::COOKIE_INVITE, $invite_code);
     return id(new AphrontRedirectResponse())->setURI('/auth/start/');
 }
开发者ID:pugong,项目名称:phabricator,代码行数:39,代码来源:PhabricatorAuthInviteController.php


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