我正在使用zend框架2.我想在网站的根目录下放置几个页面。即如何使用zend 2路由将页面路由到站点的根目录
www.exampleSite.com/siteMap
我知道如何在一个子目录页面。
即
www.exampleSite.com/support/helppage
'router' => array(
'routes' => array(
'supportsec' => array(
'type' => 'segment',
'options' => array(
'route' => '/support[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'support\Controller\supportController',
'action' => 'index',
),
),
),), ),
我也知道如何路由到主页即
'home' => array(
'type' => 'Zend\Mvc\Router\Http\Literal',
'options' => array(
'route' => '/',
'defaults' => array(
'controller' => 'Members\Controller\HomeController',
'action' => 'index',
),
),
),
的混淆是如何将其他页面放置在网站的根目录中。
预先感谢帮助
我也跟着@exlord的意见,并把这个我的模块中。
'my-static-page-1' => array(
'type' => 'Zend\Mvc\Router\Http\Literal',
'options' => array(
'route' => '/my-static-page-1',
'defaults' => array(
'controller' => 'Members\Controller\HomeController',
'action' => 'my-static-page-1',
),
),
),
我现在能够有一个页面,如:
www.exampleSite.com/examplepage
但是路由仅发送路线指数
'会员\控制器\ HomeController的'
然而我需要发送路由到动作功能的例子页面,例如
examplepageAction(){
}
我需要做什么?
你能否详细说明你的困惑在路由?您能否提供一些路由示例来更清楚地了解您的问题? – 2014-10-09 05:17:11