<?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. POJ 3321 Apple Tree DFS序 + 树状数组

    多次修改一棵树节点的值,或者询问当前这个节点的子树所有节点权值总和. 首先预处理出DFS序L[i]和R[i] 把问题转化为区间查询总和问题.单点修改,区间查询,树状数组即可. 注意修改的时候也要按照d ...

  2. rabbit的简单搭建,java使用rabbitmq queue的简单例子和一些坑

    一 整合 由于本人的码云太多太乱了,于是决定一个一个的整合到一个springboot项目里面. 附上自己的项目地址https://github.com/247292980/spring-boot 以整 ...

  3. <Win7硬件故障分析>

    查看当前系统正在运行的硬件信息. 右击计算机——属性——设备管理器看到下面: 一些常见的硬件故障: 主板故障 >开机不正常,偶尔出现突然的断电现象 >明明自己选择了关机,但是还是无法关机或 ...

  4. Cucumber 场景大纲 Scenario Outlines

    引用链接:https://github.com/cucumber/cucumber/wiki/Scenario-Outlines script/cucumber --i18n zh-CN | feat ...

  5. Java 打印PDF文档的3种情况

    以下内容归纳了通过Java程序打印PDF文档时的3种情形.即: 静默打印 显示打印对话框打印 打印PDF时自定义纸张大小 使用工具:Spire.PDF for Java Jar导入: 方法1:通过官网 ...

  6. WPF动画的几种模式

    最近在用WPF做简单动画,以下是几点经验总结: 1. 使用DispatcherTimer做动画 VB6的年代大家就用Timer做动画了,不用多解释,这个DispatcherTimer和本身的Timer ...

  7. window.open()方法详解

    , 最基本的弹出窗口代码   window.open('page.html'); 2, 经过设置后的弹出窗口   window.open('page.html', 'newwindow', 'heig ...

  8. Regexp:常用的几个正则表达式

    1.isEmail /** * * @desc 判断是否为邮箱地址 * @param {String} str * @return {Boolean} */ function isEmail(str) ...

  9. Android compress 压缩 会不会失真

    微信的缩略图要求是不大于32k,这就需要对我的图片进行压缩.试了几种方法,一一道来. 代码如下 ByteArrayOutputStream baos = new ByteArrayOutputStre ...

  10. 【Shell脚本学习22】Shell 函数:Shell函数返回值、删除函数、在终端调用函数

    函数可以让我们将一个复杂功能划分成若干模块,让程序结构更加清晰,代码重复利用率更高.像其他编程语言一样,Shell 也支持函数.Shell 函数必须先定义后使用. Shell 函数的定义格式如下: f ...