本文整理匯總了PHP中route::currentRouteName方法的典型用法代碼示例。如果您正苦於以下問題:PHP route::currentRouteName方法的具體用法?PHP route::currentRouteName怎麽用?PHP route::currentRouteName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類route
的用法示例。
在下文中一共展示了route::currentRouteName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: theme_widget_items_category
/**
* ShopEx licence
*
* @copyright Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
* @license http://ecos.shopex.cn/ ShopEx License
*/
function theme_widget_items_category(&$setting)
{
// 判斷是否首頁
if (route::currentRouteName() == 'topc') {
$returnData['isindex'] = true;
}
if (false && base_kvstore::instance('topc_category')->fetch('category_ex_vertical_widget.data', $cat_list)) {
return $cat_list;
}
$returnData['data'] = app::get('topc')->rpcCall('category.cat.get.list', array('fields' => 'cat_id,cat_name'));
return $returnData;
}
示例2: handle
public function handle($request, Clousure $next)
{
$routeAs = route::currentRouteName();
$currentPermission = shopAuth::getSellerPermission();
//$currentPermission = false 表示為店主不用判斷權限
//獲取當前用戶的路由權限
if ($currentPermission && !in_array($routeAs, $currentPermission)) {
if (request::ajax()) {
return response::json(array('error' => true, 'message' => '無操作權限'));
} else {
return redirect::action('topshop_ctl_index@nopermission');
}
}
return $next($request);
}
示例3: theme_widget_index_category
/**
* ShopEx licence
*
* @copyright Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
* @license http://ecos.shopex.cn/ ShopEx License
*/
function theme_widget_index_category(&$setting)
{
// 判斷是否首頁
$A = route::currentRouteName();
//var_dump($_SERVER);
if (route::currentRouteName() == 'topc' || $_SERVER["ORIG_PATH_INFO"] == "/index.php/trading" || $_SERVER["DOCUMENT_URI"] == "/index.php/trading") {
$returnData['isindex'] = true;
}
if (false && base_kvstore::instance('topc_category')->fetch('category_ex_vertical_widget.data', $cat_list)) {
return $cat_list;
}
$returnData['data'] = app::get('topc')->rpcCall('category.cat.get.list', array('fields' => 'cat_id,cat_name'));
//var_dump($returnData);
return $returnData;
}