本文整理汇总了PHP中Laravel\Bundle::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Bundle::get方法的具体用法?PHP Bundle::get怎么用?PHP Bundle::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Laravel\Bundle
的用法示例。
在下文中一共展示了Bundle::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convention
/**
* Generate an action URI by convention.
*
* @param string $action
* @param array $parameters
* @return string
*/
protected static function convention($action, $parameters)
{
list($bundle, $action) = Bundle::parse($action);
$bundle = Bundle::get($bundle);
// If a bundle exists for the action, we will attempt to use it's "handles"
// clause as the root of the generated URL, as the bundle can only handle
// URIs that begin with that string and no others.
$root = $bundle['handles'] ?: '';
$parameters = implode('/', $parameters);
// We'll replace both dots and @ signs in the URI since both are used
// to specify the controller and action, and by convention should be
// translated into URI slashes for the URL.
$uri = $root . '/' . str_replace(array('.', '@'), '/', $action);
$uri = static::to(str_finish($uri, '/') . $parameters);
return trim($uri, '/');
}
示例2: isset
@if(isset($modules) and !empty($modules))
<?php
$installed_modules = Config::get('installed_modules');
?>
@foreach($modules as $module)
<tr id="{{$module->slug}}">
<?php
$bundle = \Laravel\Bundle::get($module->slug);
?>
<?php
$handles = isset($bundle['handles']) ? 1 : 0;
?>
@if( isset($installed_modules[$module->slug]) and $module->enabled == true and $handles == 1)
<td class="collapse"><a href="{{ URL::base().'/'.ADM_URI.'/'.$module->slug }}">{{ $module->name }}</a></td>
@else
<td class="collapse">{{ $module->name }}</td>
@endif
<td>{{ $module->description }}<p>{{ $module->requirements_to_string() }}</p></td>
<td>{{ $module->version }}</td>
<td class="action-buttons-{{$module->slug}}">
@if($module->enabled == true and isset($installed_modules[$module->slug]))
<a data-verb="PUT" data-module="modules" data-title="{{ Lang::line('modules::lang.Are you sure you wanto to disable ":module_name"?', array('module_name' => $module->name))->get(ADM_LANG) }}" class="confirm btn btn-mini" href="{{ URL::base().'/'.ADM_URI.'/' }}modules/disable/{{ $module->slug }}"><i class="icon-minus"></i> {{ Lang::line('modules::lang.disable')->get(ADM_LANG) }}</a>
@endif
@if( $module->enabled == false and isset($installed_modules[$module->slug]) )
<a data-verb="PUT" data-module="modules" data-title="{{ Lang::line('modules::lang.Are you sure you wanto to enable ":module_name"?', array('module_name' => $module->name))->get(ADM_LANG) }}" class="confirm btn btn-mini btn-success" href="{{ URL::base().'/'.ADM_URI.'/' }}modules/enable/{{ $module->slug }}"><i class="icon-plus"></i> {{ Lang::line('modules::lang.enable')->get(ADM_LANG) }}</a>
<a data-module="modules" data-verb="DELETE" data-title="{{ Lang::line('modules::lang.Are you sure you wanto to uninstall ":module_name"?', array('module_name' => $module->name))->get(ADM_LANG) }}" class="btn btn-mini btn-danger confirm" href="{{ URL::base().'/'.ADM_URI.'/' }}modules/{{ $module->slug }}"><i class="icon-remove icon-white"></i> {{ Lang::line('modules::lang.Uninstall')->get(ADM_LANG) }}</a>
示例3: convention
protected static function convention($action, $parameters)
{
list($bundle, $action) = Bundle::parse($action);
$bundle = Bundle::get($bundle);
$root = $bundle['handles'] ?: '';
$parameters = implode('/', $parameters);
$uri = $root . '/' . str_replace(array('.', '@'), '/', $action);
$uri = static::to(str_finish($uri, '/') . $parameters);
return trim($uri, '/');
}