當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。