当前位置: 首页>>代码示例>>PHP>>正文


PHP Route::current方法代码示例

本文整理汇总了PHP中Route::current方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::current方法的具体用法?PHP Route::current怎么用?PHP Route::current使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Route的用法示例。


在下文中一共展示了Route::current方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSubDomainParameter

 /**
  * Get the subdomain parameter value
  *
  * @return string|null subdomain parameter value
  */
 private function getSubDomainParameter()
 {
     if (\Route::current() && ($param = \Route::input(config('tenant.subdomain')))) {
         return $param;
     }
     return $this->extractSubdomainFromUrl();
 }
开发者ID:bernardomacedo,项目名称:laravel-tenant-subdomain,代码行数:12,代码来源:UrlGenerator.php

示例2: currentOrg

 protected function currentOrg()
 {
     if (!$this->currentOrg) {
         $this->currentOrg = Route::current()->parameter('organizations');
     }
     return $this->currentOrg;
 }
开发者ID:foxted,项目名称:Multitenant-Apps-in-Laravel,代码行数:7,代码来源:BaseController.php

示例3: __construct

 /**
  * Initializer.
  *
  * @access   public
  * @return \BaseController
  */
 public function __construct()
 {
     $this->beforeFilter('csrf', array('on' => 'post'));
     $action = explode('@', Route::current()->getAction()['controller'])[1];
     Log::info($action);
     View::share('action', $action);
 }
开发者ID:ehumps,项目名称:rendezview,代码行数:13,代码来源:BaseController.php

示例4: filter

 public function filter()
 {
     //if(Auth::guest()) return Redirect::guest('login');
     $user = \Auth::user();
     //Determinar ruta para determinar acción
     $ruta_actual = \Route::current()->getUri();
     $accion = \Accion::whereRuta($ruta_actual)->with('modulos')->get();
     //Consultar modulo(s) al que pertenece la acción
     $modulos_accion = $accion[0]->modulos;
     //Consultar roles que permiten el acceso al modulo
     foreach ($modulos_accion as $modulo) {
         $arr_roles_id_modulo[] = $modulo->roles[0]->id;
     }
     //Consultar roles del usuario
     $roles_usuario = $user->roles;
     foreach ($user->roles as $role) {
         $arr_roles_id_usuario[] = $role->id;
     }
     //Validar roles del usuario contra roles del módulo
     $arr_validacion = array_intersect($arr_roles_id_usuario, $arr_roles_id_modulo);
     if (count($arr_validacion) == 0) {
         /**
          * @todo Redireccionar a página de inicio del usuario
          */
         return \Redirect::to('/')->with('flash_message', 'No tiene los derechos para acceder a este módulo');
     }
 }
开发者ID:armandolazarte,项目名称:gia,代码行数:27,代码来源:RoleFilter.php

示例5: getSubDomainParameter

 /**
  * Get the subdomain parameter value
  *
  * @return string|null subdomain parameter value
  */
 private function getSubDomainParameter()
 {
     if (\Route::current()) {
         return \Route::input(config('tenant.subdomain'));
     }
     return null;
 }
开发者ID:emtudo,项目名称:laravel-tenant-subdomain,代码行数:12,代码来源:UrlGenerator.php

示例6: create

 /**
  * Creates the view object for the HTML client.
  *
  * @param \MW_Config_Interface $config Configuration object
  * @param array $templatePaths List of base path names with relative template paths as key/value pairs
  * @param string|null $locale Code of the current language or null for no translation
  * @return \MW_View_Interface View object
  */
 public function create(\MW_Config_Interface $config, array $templatePaths, $locale = null)
 {
     $params = $fixed = array();
     if ($locale !== null) {
         $params = \Route::current()->parameters() + \Input::all();
         $params['target'] = \Route::currentRouteName();
         $fixed = $this->getFixedParams();
         $i18n = app('\\Aimeos\\Shop\\Base\\I18n')->get(array($locale));
         $translation = $i18n[$locale];
     } else {
         $translation = new \MW_Translation_None('en');
     }
     $view = new \MW_View_Default();
     $helper = new \MW_View_Helper_Translate_Default($view, $translation);
     $view->addHelper('translate', $helper);
     $helper = new \MW_View_Helper_Url_Laravel5($view, app('url'), $fixed);
     $view->addHelper('url', $helper);
     $helper = new \MW_View_Helper_Partial_Default($view, $config, $templatePaths);
     $view->addHelper('partial', $helper);
     $helper = new \MW_View_Helper_Parameter_Default($view, $params);
     $view->addHelper('param', $helper);
     $helper = new \MW_View_Helper_Config_Default($view, $config);
     $view->addHelper('config', $helper);
     $sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
     $sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
     $helper = new \MW_View_Helper_Number_Default($view, $sepDec, $sep1000);
     $view->addHelper('number', $helper);
     $helper = new \MW_View_Helper_FormParam_Default($view, array());
     $view->addHelper('formparam', $helper);
     $helper = new \MW_View_Helper_Encoder_Default($view);
     $view->addHelper('encoder', $helper);
     $helper = new \MW_View_Helper_Csrf_Default($view, '_token', csrf_token());
     $view->addHelper('csrf', $helper);
     return $view;
 }
开发者ID:roginthomas,项目名称:aimeos-laravel,代码行数:43,代码来源:View.php

示例7: create

 /**
  * Creates the view object for the HTML client.
  *
  * @param \Aimeos\MW\Config\Iface $config Configuration object
  * @param array $templatePaths List of base path names with relative template paths as key/value pairs
  * @param string|null $locale Code of the current language or null for no translation
  * @return \Aimeos\MW\View\Iface View object
  */
 public function create(\Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null)
 {
     $params = $fixed = array();
     if ($locale !== null) {
         $params = \Route::current()->parameters() + \Input::all();
         $fixed = $this->getFixedParams();
         $i18n = app('\\Aimeos\\Shop\\Base\\I18n')->get(array($locale));
         $translation = $i18n[$locale];
     } else {
         $translation = new \Aimeos\MW\Translation\None('en');
     }
     $view = new \Aimeos\MW\View\Standard($templatePaths);
     $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation);
     $view->addHelper('translate', $helper);
     $helper = new \Aimeos\MW\View\Helper\Url\Laravel5($view, app('url'), $fixed);
     $view->addHelper('url', $helper);
     $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params);
     $view->addHelper('param', $helper);
     $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
     $view->addHelper('config', $helper);
     $sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
     $sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
     $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000);
     $view->addHelper('number', $helper);
     $helper = new \Aimeos\MW\View\Helper\Request\Laravel5($view, \Request::instance());
     $view->addHelper('request', $helper);
     $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', csrf_token());
     $view->addHelper('csrf', $helper);
     return $view;
 }
开发者ID:boiler256,项目名称:aimeos-laravel,代码行数:38,代码来源:View.php

示例8: __construct

 public function __construct($missing = false)
 {
     if ($missing) {
         return;
     }
     $this->params = \Route::current()->parameters();
 }
开发者ID:stanmay,项目名称:unflare,代码行数:7,代码来源:BaseController.php

示例9: scripts

 static function scripts($scripts)
 {
     $route = Route::current()->action;
     if ($route == "index" or $route == "archive" or $route == "search") {
         $scripts[] = Config::current()->chyrp_url . "/modules/cascade/javascript.php";
         return $scripts;
     }
 }
开发者ID:betsyzhang,项目名称:chyrp,代码行数:8,代码来源:cascade.php

示例10: evaluateTextInView

 public static function evaluateTextInView($text, $dependencies = null)
 {
     if (!$dependencies) {
         $route = \Route::current();
         $dependencies = $route->parameters();
     }
     return self::evaluateText($text, $dependencies);
 }
开发者ID:joadr,项目名称:cms,代码行数:8,代码来源:Evaluator.php

示例11: __uninstall

 static function __uninstall($confirm)
 {
     if ($confirm) {
         Category::uninstallCategorize();
     }
     Group::remove_permission('manage_categorize');
     Route::current()->remove("category/(name)/");
 }
开发者ID:betsyzhang,项目名称:chyrp,代码行数:8,代码来源:categorize.php

示例12: zbase_route_inputs

/**
 * Return all route parameters
 * @return array
 */
function zbase_route_inputs()
{
    $routing = \Route::current();
    if ($routing instanceof \Illuminate\Routing\Route) {
        return $routing->parameters();
    }
    return [];
}
开发者ID:claremontdesign,项目名称:zbase,代码行数:12,代码来源:routes.php

示例13: change_locale

 function change_locale($locale)
 {
     $route = Route::current();
     $oldParams = $route->parameters();
     unset($oldParams['lang']);
     $params = array_merge([$locale], $oldParams);
     return route($route->getName(), $params);
 }
开发者ID:administrcms,项目名称:localization,代码行数:8,代码来源:helpers.php

示例14: view

 protected function view($file = false, $data = false)
 {
     $data = (array) ($data ? $data : $this->data);
     if (!$file) {
         $file = \Route::current()->getAction()["as"];
     }
     return view($file, $data);
 }
开发者ID:alfrecuellar,项目名称:muebles,代码行数:8,代码来源:Controller.php

示例15: getAncestorNodeForCurrentRoute

 protected function getAncestorNodeForCurrentRoute()
 {
     $currentRoute = \Route::current()->getUri();
     $currentRoute = preg_replace('/^(get|post|put|delete) /i', '', $currentRoute);
     if ($navItem = NavItem::where('descendants_routes', 'LIKE', '%' . $currentRoute . '%')->first()) {
         return $navItem;
     }
     return null;
 }
开发者ID:fbf,项目名称:laravel-navigation,代码行数:9,代码来源:NavigationComposer.php


注:本文中的Route::current方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。