本文整理汇总了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')]);
}
示例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);
}
示例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());
}
示例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();
}
示例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();
}