本文整理汇总了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();
}
示例2: currentOrg
protected function currentOrg()
{
if (!$this->currentOrg) {
$this->currentOrg = Route::current()->parameter('organizations');
}
return $this->currentOrg;
}
示例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);
}
示例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');
}
}
示例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;
}
示例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;
}
示例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;
}
示例8: __construct
public function __construct($missing = false)
{
if ($missing) {
return;
}
$this->params = \Route::current()->parameters();
}
示例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;
}
}
示例10: evaluateTextInView
public static function evaluateTextInView($text, $dependencies = null)
{
if (!$dependencies) {
$route = \Route::current();
$dependencies = $route->parameters();
}
return self::evaluateText($text, $dependencies);
}
示例11: __uninstall
static function __uninstall($confirm)
{
if ($confirm) {
Category::uninstallCategorize();
}
Group::remove_permission('manage_categorize');
Route::current()->remove("category/(name)/");
}
示例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 [];
}
示例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);
}
示例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);
}
示例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;
}