本文整理汇总了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'));
}
示例2: factory
static function factory($name = null)
{
if (!$name) {
$name = \Route::currentRouteName();
}
return parent::factory($name);
}
示例3: __construct
public function __construct()
{
$this->veer = app('veer');
$this->veer->routePrepare(\Route::currentRouteName());
$this->template = $this->veer->template;
$this->middleware('early.view');
}
示例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;
}
示例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;
}
示例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());
}
示例7: isActiveRoute
function isActiveRoute($route, $output = "active")
{
if (Route::currentRouteName() == $route) {
return $output;
}
return '';
}
示例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;
}
示例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;
}
示例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'));
}
示例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']);
}
示例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;
}
示例13: setActive
/**
* Set active acording to the route
*
* @param $name
* @return string
*/
function setActive($name)
{
if (\Route::currentRouteName() == $name) {
return 'class="active"';
}
return '';
}
示例14: __construct
public function __construct()
{
parent::__construct(pathinfo(dirname(__DIR__), PATHINFO_BASENAME));
if (Route::currentRouteName() != "ToolAdvertiserManagerPreview") {
$this->loadLeftMenu('menu.tool');
}
}
示例15: routeHandler
protected function routeHandler()
{
$route_name = \Route::currentRouteName();
if (empty($route_name)) {
return false;
}
return str_replace('.', '_', strtolower($route_name));
}