本文整理匯總了PHP中Walker::orderBy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Walker::orderBy方法的具體用法?PHP Walker::orderBy怎麽用?PHP Walker::orderBy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Walker
的用法示例。
在下文中一共展示了Walker::orderBy方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sortpv
public function sortpv()
{
$valu = $_GET['valu'];
$type = $_GET['type'];
Session::put('valu', $valu);
Session::put('type', $type);
if ($type == 'provid') {
$typename = "Providers ID";
$providers = Walker::orderBy('id', $valu)->paginate(10);
} elseif ($type == 'pvname') {
$typename = "Providers Name";
$providers = Walker::orderBy('first_name', $valu)->paginate(10);
} elseif ($type == 'pvemail') {
$typename = "Providers Email";
$providers = Walker::orderBy('email', $valu)->paginate(10);
} elseif ($type == 'pvaddress') {
$typename = "Providers Address";
$providers = Walker::orderBy('address', $valu)->paginate(10);
}
return View::make('walkers')->with('title', 'Providers | Sorted by ' . $typename . ' in ' . $valu)->with('page', 'walkers')->with('walkers', $providers);
}