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


PHP RouteCollection::get方法代码示例

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


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

示例1: testRouteControllerService

 public function testRouteControllerService()
 {
     $routeCollection = new RouteCollection('baseCodeRoute', 'baseRouteName', 'baseRoutePattern', 'baseControllerServiceName');
     $routeCollection->add('view');
     $route = $routeCollection->get('view');
     $this->assertEquals('baseControllerServiceName:viewAction', $route->getDefault('_controller'));
     $this->assertEquals('baseCodeRoute', $route->getDefault('_sonata_admin'));
     $this->assertEquals('baseRouteName_view', $route->getDefault('_sonata_name'));
 }
开发者ID:natxet,项目名称:SonataAdminBundle,代码行数:9,代码来源:RouteCollectionTest.php

示例2: getRoutingOption

 /**
  * Gets named option from current route.
  *
  * @param string $name
  *
  * @return string|null
  */
 protected function getRoutingOption($name)
 {
     $option = null;
     if (!$this->routeCollection instanceof RouteCollection) {
         $this->routeCollection = $this->getRoutesCollection();
     }
     $route = $this->routeCollection->get($this->container->get('request')->get('_route'));
     if ($route instanceof Route) {
         $option = $route->getOption($name);
     }
     if (!$option && isset($this->redirectConf[$name])) {
         $option = $this->redirectConf[$name]['action'];
     }
     if (in_array($option, array(self::REDIRECT, self::REDIRECT_WITHOUT_PATH, self::NO_REDIRECT))) {
         return $option;
     }
     return null;
 }
开发者ID:Viscaweb,项目名称:MobileDetectBundle,代码行数:25,代码来源:RequestListener.php

示例3: getRoute

    /**
     * Returns the url defined by the $name
     *
     * @param strinf $name
     * @return Route
     */
    public function getRoute($name)
    {
        $this->buildRoutes();

        if (!$this->routes->has($name)) {
            return false;
        }

        return $this->routes->get($name);
    }
开发者ID:nibsirahsieu,项目名称:AdminBundle,代码行数:16,代码来源:Admin.php

示例4: configureRoutes

 /**
  * @param RouteCollection $collection
  */
 protected function configureRoutes(RouteCollection $collection)
 {
     foreach (array('edit', 'create', 'delete') as $name) {
         if ($collection->has($name)) {
             $collection->get($name)->addOptions(array('expose' => true));
         }
     }
 }
开发者ID:Aaike,项目名称:SonataDoctrinePhpcrAdminBundle,代码行数:11,代码来源:Admin.php


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