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


PHP Request::isGet方法代码示例

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


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

示例1: __invoke

 public function __invoke(Request $req, Response $res, callable $next)
 {
     $map = function ($value) {
         return ['value' => $value, 'label' => $value];
     };
     if ($req->isGet()) {
         $this->view['tpe_survey'] = ['already_using_tpe' => self::$alreadyUsingTpe, 'knowledge_levels' => array_map($map, self::$knowledgeLevels), 'assets_in_use' => array_map($map, self::$assetsInUse), 'software_in_use' => self::$softwareInUse, 'use_case' => self::$useCase];
     }
     return $next($req, $res);
 }
开发者ID:eellak,项目名称:gredu_labs,代码行数:10,代码来源:SurveyFormDefaults.php

示例2: authorizeSkillRoute

 public function authorizeSkillRoute(Request $request, Response $response, callable $next)
 {
     // Authorize portfolio middleware
     $args = $request->getAttribute('routeInfo')[2];
     if (!$args || $request->isXhr() && $request->isGet()) {
         return $next($request, $response);
     }
     $count = $this->data(Models\MemberSkills::class)->count(['member_skill_id' => (int) $args['id'], 'user_id' => $this->session->get('user_id')]);
     if ($count < 1) {
         $this->flash->addMessage('warning', 'Permission denied.');
         return $response->withRedirect($this->router->pathFor('membership-account'));
     }
     return $next($request, $response);
 }
开发者ID:phpindonesia,项目名称:phpindonesia.or.id-membership2,代码行数:14,代码来源:Middleware.php

示例3: isAcceptable

 /**
  * @param \Slim\Http\Request $request
  * @return bool
  */
 private function isAcceptable(Request $request)
 {
     $args = $request->getAttribute('routeInfo')[2];
     return !$args || $request->isXhr() && $request->isGet();
 }
开发者ID:aswitahidayat,项目名称:phpindonesia.or.id-membership2,代码行数:9,代码来源:Middleware.php

示例4: isGet

 protected function isGet()
 {
     return $this->request->isGet();
 }
开发者ID:benconnito,项目名称:kopper,代码行数:4,代码来源:Controller.php

示例5: video

 /**
  * Dislay information about the video.
  *
  * @param Request  $request  PSR-7 request
  * @param Response $response PSR-7 response
  *
  * @return Response HTTP response
  */
 public function video(Request $request, Response $response)
 {
     $params = $request->getQueryParams();
     $this->config = Config::getInstance();
     if (isset($params['url'])) {
         if (isset($params['audio'])) {
             try {
                 $url = $this->download->getURL($params['url'], 'mp3[protocol^=http]');
                 return $response->withRedirect($url);
             } catch (\Exception $e) {
                 $response = $response->withHeader('Content-Disposition', 'attachment; filename="' . $this->download->getAudioFilename($params['url'], 'bestaudio/best') . '"');
                 $response = $response->withHeader('Content-Type', 'audio/mpeg');
                 if ($request->isGet()) {
                     $process = $this->download->getAudioStream($params['url'], 'bestaudio/best');
                     $response = $response->withBody(new Stream($process));
                 }
                 return $response;
             }
         } else {
             $video = $this->download->getJSON($params['url']);
             if ($this->container instanceof Container) {
                 $this->container->view->render($response, 'video.tpl', ['video' => $video, 'class' => 'video', 'title' => $video->title, 'description' => 'Download "' . $video->title . '" from ' . $video->extractor_key]);
             }
         }
     } else {
         return $response->withRedirect($this->container->get('router')->pathFor('index'));
     }
 }
开发者ID:rudloff,项目名称:alltube,代码行数:36,代码来源:FrontController.php


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