<?php
return array(
// console 模式
'console'=>array(
'router' => array(
//....
),
),
// http 模式
'router' => array(
'router_class'=>null, // Zend\Mvc\Router\Http\TreeRouteStack 路由栈
'route_plugins'=>null, // Zend\Mvc\Router\RoutePluginManager 路由插件管理器
'default_params'=>array( // 默认参数
'key1'=>'key1_value',
'key2'=>'key2_value'
),
'prototypes'=>null, // 原型
'routes' => array(
'routename_Hostname' => array(
/*
例子:
访问地址:
http://www22.domain.com 那么路由的参数是:
array(
'controller'=>'Module1\Controller\Index',
'action' => 'index',
'subdomain'=>'www22',
)
*/
'type' => 'Zend\Mvc\Router\Http\Hostname', // "路由匹配器"
'priority' => null, // 当前"路由匹配器"的权重
'options' => array( // 当前"路由匹配器"的配置
'route' => ':subdomain.domain.com', // 以www+2个数字开头的域名
'constraints' => array(
'subdomain' => 'www\d{2}', // 匹配表达式 "(^www\d{2}$)"
),
'defaults' => array(
'controller' => 'Module1\Controller\Index',
'action' => 'index',
),
),
),
'modules.domain.com' => array(
/*
例子:
访问地址:
http://modules.dev.domain.com 那么路由的参数是:
array(
'controller'=>'Module1\Controller\Index',
'action' => 'index',
'4th'=>'modules',
'3rd'=>'dev',
'2nd'=>'domain',
'1st'=>'com',
)
*/
'type' => 'Zend\Mvc\Router\Http\Hostname',
'priority' => null,
'options' => array(
'route' => ':4th.[:3rd.]:2nd.:1st', // 匹配表达式 "(?P<param1>modules)(?:(?P<param2>.*?))?(?P<param3>domain)(?P<param4>com)"
'constraints' => array(
'4th' => 'modules',
'3rd' => '.*?', // 第三级可选域如:.ci, .dev 或 .test
'2nd' => 'domain',
'1st' => 'com',
),
'defaults' => array(
'controller' => 'Module1\Controller\Index',
'action' => 'index',
)
),
),
'routename_Literal' => array(
/*
例子:
访问地址:
http://www.domain.com/test 那么路由的参数是:
array(
'controller'=>'Module1\Controller\TestController',
'action' => 'index',
)
*/
'type' => 'Zend\Mvc\Router\Http\Literal',
'priority' => null,
'options' => array(
'route' => '/test', // 地址片段匹配
'defaults' => array(
'controller' => 'Module1\Controller\TestController',
'action' => 'index',
),
),
),
'routename_Literal' => array(
/*
例子:
---------
访问地址:
http://www.domain.com/ 那么路由的参数是:
array(
'controller'=>'Module1\Controller\IndexController',
'action' => 'index',
)
---------
访问地址:
http://www.domain.com/blog 那么路由的参数是:
array(
'controller'=>'Module1\Controller\BlogController',
'action' => 'index',
)
---------
访问地址:
http://www.domain.com/album 那么路由的参数是:
array(
'controller'=>'Module1\Controller\AlbumController',
'action' => 'index',
)
*/
'type' => 'Zend\Mvc\Router\Http\Literal',
'priority' => null,
'options' => array(
'route' => '/', // 地址片段匹配,如"/"开头
'defaults' => array(
'controller' => 'Module1\Controller\IndexController',
'action' => 'index',
),
),
'may_terminate' => true, // 是否匹配到立刻返回
'child_routes' => array( // 如果有配置child_routes,那么要降级作为 Zend\Mvc\Router\Http\Part 的内部对象
'blog' => array(
'type' => 'literal',
'options' => array(
'route' => '/blog', // 地址片段匹配,匹配的地址是 /blog
'defaults' => array(
'controller' => 'Module1\Controller\BlogController',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
),
),
'album' => array(
'type' => 'Zend\Mvc\Router\Http\Segment',
'options' => array(
'route' => '/album[/:controller[/:action]]', // 匹配表达式 "/album(?:(?P<param1>/[a-zA-Z][a-zA-Z0-9_-]*)(?:(?P<param2>/[a-zA-Z][a-zA-Z0-9_-]*))?)?"
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
'controller' => 'Module1\Controller\AlbumController',
'action' => 'index',
),
),
),
),
),
'routename_Method' => array(
/*
例子:
访问地址:
在verb集合中的,都能匹配到 那么路由的参数是:
array(
'controller'=>'Module1\Controller\IndexController',
'action' => 'index',
)
*/
'type' => 'Zend\Mvc\Router\Http\Method',
'priority' => null,
'options' => array(
'verb' => 'POST,GET,PUT,DELETE,HEAD', // 匹配请求方式
'defaults' => array(
'controller' => 'Module1\Controller\IndexController',
'action' => 'index',
),
),
),
'routename_Query' => array(
/*
例子:
访问地址:
任何访问地址,都能匹配到 那么路由的参数是:
array(
'controller'=>'Module1\Controller\IndexController',
'action' => 'index',
)
*/
'type' => 'Zend\Mvc\Router\Http\Query',
'priority' => null,
'options' => array( // 没有匹配规则
'defaults' => array(
'controller' => 'Module1\Controller\IndexController',
'action' => 'index',
'key1' => 'key1_value',
),
),
),
'routename_Regex' => array(
/*
例子:
访问地址:
http://www.domain.com/blog/ctrl1/act1 那么路由的参数是:
array(
'controller'=>'Module1\Controller\IndexController',
'action' => 'act1',
'format' => 'html',
)
*/
'type' => 'Zend\Mvc\Router\Http\Regex',
'priority' => null,
'options' => array(
'regex'=>'/blog/(?P<controller>\w+)/(?P<action>\w+)', // 正则表达式匹配
'spec' => '/blog/%controller%/%action%',
'defaults' => array(
'controller' => 'Module1\Controller\IndexController',
'action' => 'index',
'format' => 'html',
),
),
),
'routename_Scheme' => array(
/*
例子:
访问地址:
scheme一致,都能匹配到 那么路由的参数是:
array(
'controller'=>'Module1\Controller\IndexController',
'action' => 'index',
)
*/
'type' => 'Zend\Mvc\Router\Http\Scheme',
'priority' => null,
'options' => array(
'scheme'=>'https', // Scheme匹配
'defaults' => array(
'https' => true,
),
),
),
'routename_Segment' => array(
/*
例子:
访问地址:
scheme一致,都能匹配到 那么路由的参数是:
array(
'controller'=>'Module1\Controller\IndexController',
'action' => 'index',
)
*/
'type' => 'Zend\Mvc\Router\Http\Segment',
'priority' => null,
'options' => array(
'route' => '/album[/:action][/:id]', // 匹配表达式 "/album(?:(?P<param1>/[a-zA-Z][a-zA-Z0-9_-]*))?(?:(?P<param2>/[0-9]+))?"
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Module1\Controller\AlbumController',
'action' => 'index',
),
),
),
'routename_Wildcard' => array(
/*
例子:
访问地址:
http://www.domain.com/key1=key1_value/key2=key2_value 那么路由的参数是:
array(
'controller'=>'Module1\Controller\IndexController',
'action' => 'index',
'key1' => 'key1_value',
'key2' => 'key2_value',
)
*/
'type' => 'Zend\Mvc\Router\Http\Wildcard',
'priority' => null,
'options' => array(
'param_delimiter'=>'/', // 两个参数之间的分隔符
'key_value_delimiter'=>'=', // 参数键值对的分隔符
'defaults' => array(
'controller' => 'Module1\Controller\Ctrl1',
'action' => 'index',
),
),
),
)
)
);

ZendFramework-2.4 源代码 - 路由(类图)的更多相关文章

  1. PowerDesigner(八)-面向对象模型(用例图,序列图,类图,生成Java源代码及Java源代码生成类图)(转)

    面向对象模型 面向对象模型是利用UML(统一建模语言)的图形来描述系统结构的模型,它从不同角度实现系统的工作状态.这些图形有助于用户,管理人员,系统分析人员,开发人员,测试人员和其他人员之间进行信息交 ...

  2. 八、面向对象模型(用例图,序列图,类图,生成Java源代码及Java源代码生成类图)

    面向对象模型 面向对象模型是利用UML(统一建模语言)的图形来描述系统结构的模型,它从不同角度实现系统的工作状态.这些图形有助于用户,管理人员,系统分析人员,开发人员,测试人员和其他人员之间进行信息交 ...

  3. ZendFramework-2.4 源代码 - ViewManager类图

  4. [转]看懂UML类图

    这里不会将UML的各种元素都提到,我只想讲讲类图中各个类之间的关系: 能看懂类图中各个类之间的线条.箭头代表什么意思后,也就足够应对 日常的工作和交流: 同时,我们应该能将类图所表达的含义和最终的代码 ...

  5. 【PowerDesigner】【10】绘制类图

    前言:我感觉我也是一知半解,参考博客的内容会比我的文章更有帮助 用途:描述项目中类与类的关系(即描述java文件) 正文: 1,新建oomFile→New Model→Model types→Obje ...

  6. Rational Rose 2003 逆向工程转换C++ / VC++ 6.0源代码成UML类图

    目录 1.安装&破解Rational Rose 2003 1.1 安装Rose 2003 1.2 破解Rose 2003 1.3运行出错“没有找到suite objects.dl” 2. Ra ...

  7. Rational Rose 2003 逆向工程转换C++源代码成UML类图

    主要介绍用户如何使用Rose的逆向工程生成UML模型,并用来进行C++代码的结构分析. Rational Rose可以支持标准C++和Visual C++的模型到代码的转换以及逆向工程.下面将详细地说 ...

  8. [.net 面向对象程序设计深入](1)UML——在Visual Studio 2013/2015中设计UML类图

    [.net 面向对象程序设计深入](1)UML——在Visual Studio 2013/2015中设计UML类图 1.UML简介 Unified Modeling Language (UML)又称统 ...

  9. UML——在Visual Studio 2013/2015中设计UML类图

    1.UML简介 Unified Modeling Language (UML)又称统一建模语言或标准建模语言. 简单说就是以图形方式表现模型,根据不同模型进行分类,在UML 2.0中有13种图,以下是 ...

  10. intellij idea 高级用法之:集成JIRA、UML类图插件、集成SSH、集成FTP、Database管理

    之前写过一篇IntelliJ IDEA 13试用手记,idea还有很多高大上的功能,易用性几乎能与vs.net媲美,反正我自从改用idea后,再也没开过eclipse,今天来看几个高级功能: 一.与J ...

随机推荐

  1. 台州OJ 3709: Number Maze (数组越界不报RE,报WA坑爹)

    http://acm.tzc.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=3709 You are playing on ...

  2. Java集合——List集合

    1.集合框架的作用 在实际开发中,我们经常会对一组相同类型的数据进行统一管理操作.到目前为止,我们可以使用数组结构,链表结构,二叉树结构来实现. 数组的最大问题在于数组中的元素个数是固定的,要实现动态 ...

  3. php面试题分享

    1.nginx使用哪种网络协议? nginx是应用层 我觉得从下往上的话 传输层用的是tcp/ip 应用层用的是http fastcgi负责调度进程 2. <? echo 'hello tush ...

  4. jquery选择器大全参考

    在Dom 编程中我们只能使用有限的函数根据id 或者TagName 获取Dom 对象. 然而在jQuery 中则完全不同,jQuery 提供了异常强大的选择器用来帮助我们获取页面上的对象, 并且将对象 ...

  5. python 发布

    使用distutils.core.setup函数发布程序 将要发布的包放到mypub的目录下 在mypub目录下创建一个setup.py文件 setup.py文件的设置 from distutils. ...

  6. 使用Fsharp 探索 Dotnet 平台

    Fsharp的交互开发环境使得我们在了解DotNet平台时能够快速的获得需要的反馈. 反馈在任何技艺的磨练过程中必不可少,我认为也是最重要的环节之一.在“一万小时天才理论”中,著名的髓鞘质就是在快速有 ...

  7. Apache activiti5.13工作流框架的表结构详解

    1.结构设计 1.1.    逻辑结构设计 Activiti使用到的表都是ACT_开头的. ACT_RE_*: ’RE’表示repository(存储),RepositoryService接口所操作的 ...

  8. Web前端开发的学习过程

    2018年 5月27日 开始在MDN上学习HTML/CSS/JavaScript.——6月18日 基本学完MDN的“学习Web开发”的HTML/CSS/JavaScript部分. 6月9日 开始在IF ...

  9. leetcode85 Maximal Rectangle

    思路: 分别按行拆分后将这一行之前的每列叠加起来,然后使用leetcode84https://www.cnblogs.com/wangyiming/p/9620942.html的思路计算. 实现: # ...

  10. This is your path and you will pursue it with excellence.

    This is your path and you will pursue it with excellence.自己选的路就要走出精彩.