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


PHP Bundle::get方法代码示例

本文整理汇总了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, '/');
 }
开发者ID:ibrarturi,项目名称:laravel-tutorial,代码行数:23,代码来源:url.php

示例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 &#34;:module_name&#34;?', 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 &#34;:module_name&#34;?', 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 &#34;:module_name&#34;?', 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>
开发者ID:juaniiie,项目名称:mwi,代码行数:31,代码来源:modules_index_table.blade.php

示例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, '/');
 }
开发者ID:laravelbook,项目名称:framework3,代码行数:10,代码来源:laravel_lite.php


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