本文整理汇总了PHP中Illuminate\Support\Facades\Request::getQueryString方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getQueryString方法的具体用法?PHP Request::getQueryString怎么用?PHP Request::getQueryString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Request
的用法示例。
在下文中一共展示了Request::getQueryString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getValues
/**
* Creates an array representation (Map) of the Query String parameters present.
*
* @return array
*/
public function getValues()
{
$qs = Request::getQueryString();
$result = [];
// if we don't have any params at all
if (strpos($qs, '=') === FALSE) {
return $result;
}
// if we have multiple params set
if (strpos($qs, '&') !== FALSE) {
foreach (explode('&', $qs) as $segment) {
$result[] = $this->splitSegment($segment);
}
return $result;
}
// if we only have one set
return [$this->splitSegment($qs)];
}
示例2: category
public function category()
{
//列表
$para = Request::getQueryString();
$shops = $this->shop->getGoods($this->shop, $para, '', 'copy');
//推荐的前三个
$filter = [['recomment', '=', 1], ['num', '=', 1], ['status', '=', 1]];
$fields = ['id', 'title', 'category_id', 'price', 'thumb'];
$order = [['sorts', 'asc'], ['updated_at', 'desc']];
$shops['recomment_lists'] = $this->shop->getShopList($this->shop, $filter, $fields, $order, 0, 3, 0);
//分类
$shops['categories'] = $this->categories;
//当前分类
$shops['category'] = $this->category->find(Request::get('b'))->name;
//价格区间
$shops['price'] = Config::get("shop::copy.price");
//交易方式
$shops['trade'] = Config::get("shop::copy.trade");
$shops['url'] = 'shop.copy.category';
return View::make('shop::copy.category', compact('shops'));
}
示例3: category
public function category()
{
//列表
$para = Request::getQueryString();
$shops = $this->shop->getGoods($this->shop, $para, '', 'logo');
//分类
$shops['categories'] = $this->categories;
if (Request::get('b')) {
$b = Request::get('b');
if (preg_match("/^[0-9]+\$/", $b)) {
$shops['recomment_category'] = $this->category->find($b)->toArray();
} else {
$c_arr = explode('c', $b);
$shops['recomment_category'] = $this->category->find($c_arr[0])->toArray();
}
} else {
$shops['recomment_category'] = $this->reco_categories;
}
//dd($shops['recomment_category']);
//组合类型
$shops['combine'] = Config::get("shop::logo.combine");
//价格区间
$shops['price'] = Config::get("shop::logo.price");
//交易方式
$shops['trade'] = Config::get("shop::logo.trade");
$shops['url'] = 'shop.logo.category';
return View::make('shop::logo.category', compact('shops'));
}