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


PHP Bundle::routes方法代码示例

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


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

示例1: uses

 /**
  * Find the route that uses the given action.
  *
  * @param  string  $action
  * @return array
  */
 public static function uses($action)
 {
     // If the action has already been reverse routed before, we'll just
     // grab the previously found route to save time. They are cached
     // in a static array on the class.
     if (isset(static::$uses[$action])) {
         return static::$uses[$action];
     }
     Bundle::routes(Bundle::name($action));
     // To find the route, we'll simply spin through the routes looking
     // for a route with a "uses" key matching the action, and if we
     // find one, we cache and return it.
     foreach (static::routes() as $method => $routes) {
         foreach ($routes as $key => $value) {
             if (isset($value['uses']) and $value['uses'] === $action) {
                 return static::$uses[$action] = array($key => $value);
             }
         }
     }
 }
开发者ID:shawon922,项目名称:LaravelBackboneTodoMVC,代码行数:26,代码来源:router.php

示例2: uses

 public static function uses($action)
 {
     if (isset(static::$uses[$action])) {
         return static::$uses[$action];
     }
     Bundle::routes(Bundle::name($action));
     foreach (static::routes() as $method => $routes) {
         foreach ($routes as $key => $value) {
             if (isset($value['uses']) and $value['uses'] === $action) {
                 return static::$uses[$action] = array($key => $value);
             }
         }
     }
 }
开发者ID:laravelbook,项目名称:framework3,代码行数:14,代码来源:laravel_lite.php


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