本文整理汇总了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;
}