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


PHP Route::currentRouteAction方法代码示例

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


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

示例1: _getViewName

 private function _getViewName()
 {
     $viewName = strtolower(Route::currentRouteAction());
     $viewName = str_replace("@", ".", $viewName);
     $viewName = str_replace("controller", "", $viewName);
     return $viewName;
 }
开发者ID:NeZanyat,项目名称:laravel-example,代码行数:7,代码来源:BaseController.php

示例2: __construct

 public function __construct()
 {
     $route = \Route::currentRouteAction();
     list($controller, $action) = explode('@', $route);
     $this->controller = $controller;
     $this->action = $action;
 }
开发者ID:Zachary-Leung,项目名称:wine_platform,代码行数:7,代码来源:CommonController.php

示例3: __construct

 public function __construct()
 {
     $this->beforeFilter('auth.admin');
     $this->hasUnverifiedUsers = Client::where('is_verified', '=', 0)->count();
     $this->hasUsersInWaitlist = Client::where('on_waitlist', '=', 1)->count();
     View::share('actionName', explode('@', Route::currentRouteAction())[1]);
     $this->userRules = array('email' => 'required|email', 'first_name' => 'required', 'last_name' => 'required');
 }
开发者ID:uTosTan,项目名称:codesamples,代码行数:8,代码来源:AdminController.php

示例4: loadControllerJavascript

 /**
  * Find the associated Javascript for this controller, if it exists
  * @return string javascript filename to load
  */
 private function loadControllerJavascript()
 {
     preg_match('/([a-zA-Z]+)@/iU', \Route::currentRouteAction(), $controller);
     $file = strtolower($controller[1]);
     if (file_exists(dirname(__FILE__) . "/../../../public/javascripts/{$file}.js")) {
         return $file;
     }
 }
开发者ID:jakobbuis,项目名称:bolknoms2,代码行数:12,代码来源:Application.php

示例5: getController

 protected function getController()
 {
     $controller = \Illuminate\Support\Str::parseCallback(\Route::currentRouteAction(), null)[0];
     if (!preg_match('/^App\\\\Http\\\\Controllers\\\\([a-zA-Z\\\\]+)Controller$/', $controller, $controller_matches)) {
         throw new \Exception('Could not parse controller.');
     }
     return strtolower(str_replace('\\', '/', Str::camelCaseToHyphen($controller_matches[1])));
 }
开发者ID:pxlbros,项目名称:pxlframework,代码行数:8,代码来源:CoreController.php

示例6: redact

 /**
  * Redirect to action.
  *
  * @param string $name
  * @param array  $parameters
  * @param int    $status
  * @param array  $headers
  * @param bool   $secure
  *
  * @return Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
  */
 function redact($name, $parameters = [], $status = 302, $headers = [], $secure = null)
 {
     if (preg_match('/^_self@/', $name)) {
         $controller = explode('\\', strtok(Route::currentRouteAction(), '@'));
         $name = preg_replace('/^_self@/', end($controller) . '@', $name);
     }
     return redirect(action($name, $parameters), $status, $headers, $secure);
 }
开发者ID:lbausch,项目名称:laravel-cornerstone,代码行数:19,代码来源:helpers.php

示例7: __construct

 /**
  * Instantiate a new UserManagementController instance.
  */
 public function __construct()
 {
     $this->beforeFilter('auth');
     if (Request::segment(4) || strpos(Route::currentRouteAction(), 'create') && Request::segment(3) || strpos(Route::currentRouteAction(), 'store') && Request::segment(3)) {
         $this->beforeFilter('auth.manager');
     } else {
         $this->beforeFilter('auth.admin');
     }
 }
开发者ID:digideskio,项目名称:voip-id,代码行数:12,代码来源:UserManagementController.php

示例8: filter

 /**
  * filter 実装
  */
 public function filter()
 {
     list($controller, $method) = explode('@', \Route::currentRouteAction());
     $reflectionClass = new \ReflectionClass($controller);
     $constant = $reflectionClass->getConstant('SESSION_KEY');
     if (!\Session::get($constant)) {
         return \Redirect::route($this->redirectForm());
     }
 }
开发者ID:k-kurikuri,项目名称:Laravel.JpRecipe,代码行数:12,代码来源:PostOnceFilter.php

示例9: __construct

 public function __construct()
 {
     $this->beforeFilter(function () {
         $exclude = array("HomeController@getIndex");
         $cra = Route::currentRouteAction();
         if (Auth::guest() && !in_array($cra, $exclude)) {
             return Redirect::action('SteamLoginController@getLogin');
         }
     });
 }
开发者ID:TsunamiNori,项目名称:Raffles,代码行数:10,代码来源:HomeController.php

示例10: current_route

function current_route($type)
{
    $path = explode('@', Route::currentRouteAction());
    $pathc = explode("\\", $path[0]);
    if ($type == 'class') {
        return strtolower(end($pathc));
    } else {
        return end($path);
    }
}
开发者ID:aldiunanto,项目名称:gbb_laravel,代码行数:10,代码来源:Utilities.php

示例11: check

 public function check($name = null)
 {
     $user = $this->user();
     $name = $name ?: \Route::currentRouteAction();
     if (is_null($user)) {
         return false;
     }
     if (!method_exists($user, 'hasPermissionTo')) {
         return false;
     }
     if (!$user->hasPermissionTo($name)) {
         return false;
     }
     return true;
 }
开发者ID:Anshdesire,项目名称:laravel-api,代码行数:15,代码来源:TokenGuard.php

示例12: interpretException

 private function interpretException()
 {
     $e = $this->exception;
     $custom_error = (object) $this->custom_error;
     $custom_error->time = date(config('lab1353/errors.format_date', 'd/m/Y H:i:s'));
     $custom_error->type = get_class($e);
     //$custom_error->code	= $e->getCode();
     $custom_error->code = $e->getCode() > 0 || empty($e->getStatusCode()) ? $e->getCode() : $e->getStatusCode();
     $custom_error->url = request()->url();
     $custom_error->route = \Route::currentRouteAction();
     $custom_error->file = $e->getFile();
     $custom_error->line = $e->getLine();
     $custom_error->message = (string) $e->getMessage();
     $custom_error->trace = $e->getTrace();
     return $custom_error;
 }
开发者ID:lab1353,项目名称:errors,代码行数:16,代码来源:ErrorsLog.php

示例13: index

 /**
  * @Get("test99999", lilichun123="chun")
  */
 public function index()
 {
     return response(['aa' => '123'], 400);
     dd(app(\App\Contracts\IAclModule::class)->routeModuleList());
     die;
     foreach (\Route::getRoutes() as $item) {
         dd($item->getAction());
     }
     die;
     dump(\Route::currentRouteAction());
     foreach (\Route::getRoutes() as $item) {
         //            dd($item);
         dump($item->getAction());
     }
     return '123123';
 }
开发者ID:Fakeronline,项目名称:wechat_manage,代码行数:19,代码来源:TestController.php

示例14: handle

 /**
  * Test handler
  * @param  [type]  $request [description]
  * @param  Closure $next    [description]
  * @return [type]           [description]
  */
 public function handle($request, Closure $next)
 {
     $controller_id = str_replace('/index', '', action("\\" . \Route::currentRouteAction()));
     $controller_id = str_replace($controller_id, '', \URL::current());
     $controller_id = trim($controller_id, '/');
     $perm = \Permission::checkPermission(\Route::currentRouteAction(), $controller_id, false);
     if ($perm === true) {
         //preceed with the normal request
     } else {
         if (@\Auth::user()->id) {
             \Session::flash('danger', "You do not have permission to do that.");
         }
         return $perm;
     }
     return $next($request);
 }
开发者ID:ryzr,项目名称:bootlegcms,代码行数:22,代码来源:Permissions.php

示例15: __construct

 public function __construct()
 {
     // Set up some standard body classes for easy CSS targeting
     $calledClass = strtolower(get_called_class());
     $namespaces = str_ireplace('App\\Http\\Controllers\\', '', $calledClass);
     $namespaces = explode('\\', $namespaces);
     array_pop($namespaces);
     $this->bodyClasses += $namespaces;
     $this->bodyClasses[] = str_ireplace('controller', '', class_basename($calledClass));
     $action = \Route::currentRouteAction();
     $action = substr($action, strpos($action, "@") + 1);
     $this->bodyClasses[] = \App\Helpers\Text::camelToDashes(str_ireplace(['get', 'post', 'put', 'delete'], '', $action));
     \View::share('bodyClass', implode(' ', $this->bodyClasses));
     // The timezone that should be used when displaying information
     $this->timezone = 'America/Denver';
     \View::share('timezone', $this->timezone);
 }
开发者ID:joshhudnall,项目名称:beancounter,代码行数:17,代码来源:Controller.php


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