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


PHP Route::currentRouteName方法代码示例

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


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

示例1: harian

 public function harian()
 {
     $bil = 1;
     $laporans = Laporan::latest('tarikh')->assigned()->today()->get();
     \Session::put('lastReport', \Route::currentRouteName());
     return View('members.technician.harian', compact('bil', 'laporans'));
 }
开发者ID:suhairi,项目名称:maintenance,代码行数:7,代码来源:LaporanController.php

示例2: factory

 static function factory($name = null)
 {
     if (!$name) {
         $name = \Route::currentRouteName();
     }
     return parent::factory($name);
 }
开发者ID:larakit,项目名称:lk,代码行数:7,代码来源:WidgetSubpages.php

示例3: __construct

 public function __construct()
 {
     $this->veer = app('veer');
     $this->veer->routePrepare(\Route::currentRouteName());
     $this->template = $this->veer->template;
     $this->middleware('early.view');
 }
开发者ID:artemsk,项目名称:veer-core,代码行数:7,代码来源:Controller.php

示例4: getType

 /**
  * @return string
  */
 protected function getType()
 {
     if ($this->type) {
         return $this->type;
     }
     return Str::startsWith(\Route::currentRouteName(), 'admin.plugins') ? self::TYPE_PLUGINS : self::TYPE_WIDGETS;
 }
开发者ID:marcmascarell,项目名称:laravel-artificer,代码行数:10,代码来源:ExtensionController.php

示例5: render_navigation

/**
 * render_navigation()
 */
function render_navigation($depth = -1, $tree = NULL, &$html = '', $level = 0, $preroute = '')
{
    $html .= $level > 0 ? '<ul class="sub l' . $level . '">' : '<ul>';
    if (is_null($tree)) {
        $tree = Lang::get('routes');
    }
    foreach ($tree as $route => $item) {
        if (isset($item['nav']) && $item['nav'] != NULL) {
            $active = $route == Route::currentRouteName();
            if ($route == 'news' && substr(Route::currentRouteName(), 0, 5) == 'news.') {
                $active = true;
            }
            $html .= '<li>';
            $html .= '<a href="' . route($route) . ($route == 'home' ? '/' : '') . '"' . ($active ? ' class="active"' : '') . '>' . $item['nav'] . '</a>';
            if (isset($item['sub']) && is_array($item['sub'])) {
                if ($depth == -1 || $level < $depth) {
                    render_navigation($depth, $item['sub'], $html, $level + 1, $preroute . $route . '.sub.');
                }
            }
            $html .= '</li>';
        }
    }
    $html .= '</ul>';
    return $html;
}
开发者ID:polto,项目名称:website,代码行数:28,代码来源:nav.php

示例6: setSharedVariables

 /**
  * Share common view variables
  */
 protected function setSharedVariables()
 {
     view()->share('currentLocale', app()->getLocale());
     view()->share('currentUser', auth()->user());
     view()->share('currentRouteName', \Route::currentRouteName());
     view()->share('currentUrl', \Request::fullUrl());
 }
开发者ID:gabrieljo,项目名称:l5essential,代码行数:10,代码来源:Controller.php

示例7: isActiveRoute

function isActiveRoute($route, $output = "active")
{
    if (Route::currentRouteName() == $route) {
        return $output;
    }
    return '';
}
开发者ID:joshforbes,项目名称:westcoastffl,代码行数:7,代码来源:helpers.php

示例8: is_done

 /**
  * Check weather or not the step is complete
  *
  * @param $step
  * @return null|string
  */
 function is_done($step)
 {
     $steps = steps();
     $step = array_search($step, $steps);
     $current_step = array_search(Route::currentRouteName(), $steps);
     return $current_step > $step ? 'done' : NULL;
 }
开发者ID:huludini,项目名称:aura-kingdom-web,代码行数:13,代码来源:helpers.php

示例9: layout

 /**
  * @param $tpl
  *
  * @return $this
  */
 function layout($tpl = null)
 {
     //        $template = explode('::', $as);
     //        if (count($template) > 1) {
     //            $namespace = Arr::get($template, 0);
     //            if (substr_count($namespace, '-') && substr_count(Arr::get($template, 1), '.')) {
     //                $package   = explode('.', Arr::get($template, 1), 3);
     //                $end       = Arr::get($package, 2, "");
     //                if ($end) {
     //                    $end = '.' . $end;
     //                }
     //                $package = Arr::get($package, 1) . '.' . Arr::get($package, 0) . $end;
     //
     //                $as = $namespace . '::' . trim($package, '.');
     //                dd($as );
     //            }
     //        }
     if (true === $tpl) {
         $this->layout = \Route::currentRouteName();
     } elseif (null !== $tpl) {
         $this->layout = $tpl;
     }
     //        dd($this->layout);
     return $this;
 }
开发者ID:larakit,项目名称:lk,代码行数:30,代码来源:Controller.php

示例10: index

 public function index()
 {
     $bil = 1;
     $laporans = Laporan::where('user', \Auth::user()->username)->where('status', 0)->get();
     \Session::put('lastReport', \Route::currentRouteName());
     return View('members.technician.laporan.cetak.index', compact('bil', 'laporans'));
 }
开发者ID:suhairi,项目名称:maintenance,代码行数:7,代码来源:CetakController.php

示例11: __construct

 /**
  * @param RoleRepositoryInterface $repository
  * @param RoleDataTable $dataTableConfig
  * @param UserDataTable $userDataTableConfig
  */
 public function __construct(RoleRepositoryInterface $repository, RoleDataTable $dataTableConfig, UserDataTable $userDataTableConfig)
 {
     $this->repository = $repository;
     $this->dataTableConfig = $dataTableConfig;
     $this->userDataTableConfig = $userDataTableConfig;
     $this->breadcrumbConfig = BreadcrumbConfigFactory::create(Route::currentRouteName(), ['role.store', 'role.update', 'role.destroy', 'role.destroy.multiple']);
 }
开发者ID:arminsam,项目名称:SimpleUserManagement,代码行数:12,代码来源:RoleController.php

示例12: 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

示例13: setActive

/**
 * Set active acording to the route
 *
 * @param $name
 * @return string
 */
function setActive($name)
{
    if (\Route::currentRouteName() == $name) {
        return 'class="active"';
    }
    return '';
}
开发者ID:vjaykoogu,项目名称:smile-media-laravel,代码行数:13,代码来源:helpers.php

示例14: __construct

 public function __construct()
 {
     parent::__construct(pathinfo(dirname(__DIR__), PATHINFO_BASENAME));
     if (Route::currentRouteName() != "ToolAdvertiserManagerPreview") {
         $this->loadLeftMenu('menu.tool');
     }
 }
开发者ID:huycao,项目名称:yoplatform,代码行数:7,代码来源:ToolAdvertiserManagerController.php

示例15: routeHandler

 protected function routeHandler()
 {
     $route_name = \Route::currentRouteName();
     if (empty($route_name)) {
         return false;
     }
     return str_replace('.', '_', strtolower($route_name));
 }
开发者ID:sunel,项目名称:laravel-layout,代码行数:8,代码来源:Html.php


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