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


PHP Route::getCurrentRoute方法代码示例

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


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

示例1: admin_header_active

/**
 *
 */
function admin_header_active($name)
{
    if (Route::getCurrentRoute()->getName() == $name) {
        return 'active';
    }
    return '';
}
开发者ID:victorboissiere,项目名称:Synergie,代码行数:10,代码来源:helpers.php

示例2: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$this->modelAdmin->find(\Route::getCurrentRoute()->getParameter('one'))) {
         return Response::view('flare::admin.404', [], 404);
     }
     return $next($request);
 }
开发者ID:laravelflare,项目名称:flare,代码行数:15,代码来源:CheckModelFound.php

示例3: setUp

 protected function setUp()
 {
     $this->current_route = Route::getCurrentRoute()->getName();
     $this->logged_user = Sentry::getUser();
     View::share('logged_user', $this->logged_user);
     View::share('current_route', $this->current_route);
 }
开发者ID:nurulimamnotes,项目名称:point-of-sale,代码行数:7,代码来源:BaseController.php

示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $route = Route::getCurrentRoute()->getPath();
     if ('/admin/disciplinas' == $route) {
         $conteudoDisciplinas = new Disciplinas();
         /*$id = Input::get('id');
           if($id>0){
               $conteudoDisciplinas = Disciplinas::find($id);
           }*/
         $conteudoDisciplinas->nome_dis = Request::get('nomeDisciplina');
         $conteudoDisciplinas->codigo_dis = Request::get('codigoDisciplina');
         $conteudoDisciplinas->periodo_dis = Request::get('periodoDisciplina');
         $conteudoDisciplinas->save();
         $value = array('success' => true);
         //        return json_encode($value);
         return Redirect::to('/admin/disciplinas');
     }
     if ('/admin/professores' == $route) {
         return 'oi';
     }
     /*switch($route){
                 case '/admin/disciplinas/add':
                     $queryBuilder = 'Disciplinas';
                     break;
                 default:
                     break;
             }
     
             $updater    = new $queryBuilder();*/
 }
开发者ID:WallisonStorck,项目名称:sgd,代码行数:35,代码来源:ApiConteudoController.php

示例5: routeActive

 function routeActive($route, $children = [], $simple = false)
 {
     $found = false;
     $currentRoute = Route::getCurrentRoute()->getName();
     if ($children instanceof Illuminate\Support\Collection) {
         $children = $children->toArray();
     }
     if ($route == $currentRoute || in_array($currentRoute, $children)) {
         $found = true;
     } elseif (substr($route, -1) == '*' && checkPartialRoute($route, $currentRoute) == true) {
         $found = true;
     } else {
         foreach ($children as $child) {
             if (checkPartialRoute($child, $currentRoute) == true) {
                 $found = true;
                 break;
             }
         }
     }
     if ($found == true) {
         if ($simple) {
             return 'active';
         } else {
             return "class='active'";
         }
     }
 }
开发者ID:nukacode,项目名称:nukacode,代码行数:27,代码来源:route.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     /*
      * return paginated results to do infinite scroll, maybe?
      */
     $works = Work::with(['photos' => function ($photos) {
         /*
          * Return only the selected columns
          *
          * Includes the foreign key to the field list,
          * or else Laravel won't be able to link the
          * models together
          */
         $photos->addSelect(['id', 'filename', 'work_id']);
     }, 'agency' => function ($agencies) {
         /*
          * Return only the selected columns
          *
          * No need to include foreing key here since
          * Work "belongsTo" an agency
          */
         $agencies->addSelect(['id', 'name']);
         // @TODO ✅ Lower this pagination?
     }])->latest()->published()->orderBy('featured', 'desc')->paginate(50);
     /*
      * If we are in the admin panel, render a view
      * otherwise return as json
      */
     $routeName = \Route::getCurrentRoute()->getName();
     return $routeName == 'dash.works' ? view('dashboard.works.index', compact('works')) : $works;
 }
开发者ID:Alxmerino,项目名称:portfolio-16v.laravel,代码行数:36,代码来源:WorkController.php

示例7: __construct

 public function __construct()
 {
     if (\App::runningInConsole()) {
         $this->request = [];
     } else {
         $this->request = ['url' => request()->url(), 'method' => request()->method(), 'input' => request()->input(), 'action' => \Route::getCurrentRoute() !== null ? \Route::getCurrentRoute()->getAction() : null, 'headers' => request()->header()];
     }
 }
开发者ID:lsrur,项目名称:inspector,代码行数:8,代码来源:RequestCollector.php

示例8: getActive

function getActive($id)
{
    $currentRoute = Route::getCurrentRoute()->getParameter('category_id');
    if ($id == $currentRoute) {
        return 'active';
    }
    return '';
}
开发者ID:nhatkhoa,项目名称:GroupBuy,代码行数:8,代码来源:sidebar-left.blade.php

示例9: _headerTitle

 /**
  * Return the header title for each page
  *
  * @return string
  */
 function _headerTitle()
 {
     $route = Route::currentRouteName();
     $title = '<h1 class="page-heading">';
     $title .= trans(Route::getCurrentRoute()->getName());
     $title .= '</h1>';
     return $title;
 }
开发者ID:abada,项目名称:xadmin,代码行数:13,代码来源:GeneralHelper.php

示例10: getActiveLink

function getActiveLink($name)
{
    $current = Route::getCurrentRoute()->getPath();
    if ($name == $current) {
        echo 'active';
    }
    echo '';
}
开发者ID:nhatkhoa,项目名称:GroupBuy,代码行数:8,代码来源:admin.blade.php

示例11: getIndex

 public function getIndex()
 {
     $id = Sentry::getUser()->id;
     $hoy = date('Y-m-d');
     $ruta = \Route::getCurrentRoute();
     $data['url'] = url($ruta->getPath());
     $data['bitacoras'] = Bitacora::where('usuario_id', '=', $id)->where('ind_atendida', '=', 'false')->where('ind_alarma', '=', 'true')->where('fecha', '<=', $hoy)->get();
     return View::make('solicitudes.alertas', $data);
 }
开发者ID:armandolazarte,项目名称:sasyc,代码行数:9,代码来源:AlertasController.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     /*
      * Return paginated results, I might not need this route...
      */
     $photos = Photo::latest()->paginate(25);
     $routeName = \Route::getCurrentRoute()->getName();
     return $routeName == 'dash.photos' ? view('dashboard.photos.index', compact('photos')) : $photos;
 }
开发者ID:Alxmerino,项目名称:portfolio-16v.laravel,代码行数:14,代码来源:PhotoController.php

示例13: after

 public function after()
 {
     if (strlen($this->response) > 0) {
         echo $this->response;
     } else {
         $currentRoute = Route::getCurrentRoute();
         echo $this->view->render($currentRoute[1][0] . '/' . $currentRoute[1][1]);
     }
 }
开发者ID:DenchikBY,项目名称:Simple-MVC-app,代码行数:9,代码来源:Controller.php

示例14: link_to_sorting_action

 public static function link_to_sorting_action($col, $title = null)
 {
     if (is_null($title)) {
         $title = str_replace('_', ' ', $col);
         $title = ucfirst($title);
     }
     $indicator = Input::get('s') == $col ? Input::get('o') === 'asc' ? '&uarr;' : '&darr;' : null;
     $parameters = array_merge(Route::getCurrentRoute()->parameters(), array('s' => $col, 'o' => Input::get('o') === 'asc' ? 'desc' : 'asc'));
     return link_to_route(Route::currentRouteName(), "{$title} {$indicator}", $parameters);
 }
开发者ID:jeremy6680,项目名称:easy-peasy-cms,代码行数:10,代码来源:SortableTrait.php

示例15: isSelected

 /**
  * 
  * @return boolean Пункт меню выбран
  */
 public function isSelected()
 {
     // Разбираем запрос, ищем текущий элемент меню.
     $pageAction = Route::getCurrentRoute()->action;
     foreach ($this->actions as $action) {
         if ($pageAction == $action) {
             return true;
         }
     }
     return false;
 }
开发者ID:Nex-Otaku,项目名称:combo-cms,代码行数:15,代码来源:Menu.php


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