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


PHP Request::getQueryParam方法代码示例

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


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

示例1: index

 public function index(Request $request, Response $response, array $args)
 {
     $this->setPageTitle('Membership', 'Keanggotaan');
     $regionals = $this->data(Regionals::class);
     $provinceId = $request->getQueryParam('province_id');
     return $this->view->render('home-index', ['members' => $this->data(Users::class)->getMembers($request), 'provinces' => array_pairs($regionals->getProvinces(), 'id', 'regional_name'), 'cities' => array_pairs($regionals->getCities($provinceId), 'id', 'regional_name')]);
 }
开发者ID:tirta-keniten,项目名称:phpindonesia.or.id-membership2,代码行数:7,代码来源:HomeController.php

示例2: listContent

 public function listContent(Request $request, Response $response, $arguments)
 {
     $content = Content::where('content_type', $arguments['contentTypeSlug'])->orderBy('updated_at', true)->get();
     $contentTypeDefinition = $this->container->ContentService->getContentTypeDefinition($arguments['contentTypeSlug']);
     if ($request->getQueryParam('show-unpublished') !== 'true') {
         $content = $content->filter(function ($value) {
             return $value->is_published === true;
         })->values();
     }
     $content = $content->map(function ($item) use($request, $contentTypeDefinition) {
         return $this->container->ContentService->convertFields($item, $contentTypeDefinition, $request);
     });
     return $response->withJson($content, 200, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
 }
开发者ID:joppuyo,项目名称:Dullahan,代码行数:14,代码来源:ContentController.php

示例3: handleReadList

 /**
  * Handle the [GET] list view
  * @param Request $request
  * @param Response $response
  * @return Response
  */
 protected function handleReadList(Request $request, Response $response)
 {
     $model = new ProductsListModel();
     $service = $this->service;
     $filterTag = $request->getQueryParam('tag', null);
     $model->setProducts($service->readList($filterTag, 'creationDate', true));
     $model->setFilterTag($filterTag);
     return TwigUtil::render($this->container, $response, 'product/list.twig', $model->jsonSerialize());
 }
开发者ID:elegos,项目名称:PHPTest,代码行数:15,代码来源:ProductController.php

示例4: getTotalMember

 /**
  * Get Total Member
  *
  * @param \Slim\Http\Request $request Filter by request
  * @return integer
  */
 public function getTotalMember($request)
 {
     $query = $this->db->select(['u.user_id'])->from('users u')->leftJoin('members_profiles m', 'u.user_id', '=', 'm.user_id')->leftJoin('users_roles ur', 'u.user_id', '=', 'ur.user_id')->leftJoin('regionals reg_prv', 'reg_prv.id', '=', 'm.province_id')->leftJoin('regionals reg_cit', 'reg_cit.id', '=', 'm.city_id')->where('ur.role_id', '=', 'member')->where('u.activated', '=', 'Y');
     if ($request->getQueryParam('province_id')) {
         $query->where('m.province_id', '=', (int) $request->getQueryParam('province_id'));
     }
     if ($request->getQueryParam('city_id')) {
         $query->where('m.city_id', '=', (int) $request->getQueryParam('city_id'));
     }
     if ($request->getQueryParam('area')) {
         $query->whereLike('m.area', $request->getQueryParam('area'));
     }
     return $query->execute()->rowCount();
 }
开发者ID:aswitahidayat,项目名称:phpindonesia.or.id-membership2,代码行数:20,代码来源:Users.php

示例5: getMembers

 /**
  * List all members
  *
  * @param \Slim\Http\Request $request Filter by request
  * @return array
  */
 public function getMembers($request)
 {
     $query = $this->db->select(['u.user_id', 'u.username', 'u.email', 'u.created', 'ur.role_id', 'm.fullname', 'm.gender', 'm.photo', 'reg_prv.regional_name province', 'reg_cit.regional_name city'])->from('users u')->leftJoin('members_profiles m', 'u.user_id', '=', 'm.user_id')->leftJoin('users_roles ur', 'u.user_id', '=', 'ur.user_id')->leftJoin('regionals reg_prv', 'reg_prv.id', '=', 'm.province_id')->leftJoin('regionals reg_cit', 'reg_cit.id', '=', 'm.city_id')->where('ur.role_id', '=', 'member')->where('u.activated', '=', 'Y');
     if ($request->getQueryParam('province_id')) {
         $query->where('m.province_id', '=', (int) $request->getQueryParam('province_id'));
     }
     if ($request->getQueryParam('city_id')) {
         $query->where('m.city_id', '=', (int) $request->getQueryParam('city_id'));
     }
     if ($request->getQueryParam('area')) {
         $query->whereLike('m.area', $request->getQueryParam('area'));
     }
     $query->orderBy('u.created', 'DESC')->limit(18, $request->getQueryParam('page'));
     return $query->execute()->fetchAll();
 }
开发者ID:tirta-keniten,项目名称:phpindonesia.or.id-membership2,代码行数:21,代码来源:Users.php


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