westdc-zf1/module/Article/config/module.config.php

94 lines
2.8 KiB
PHP

<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
return array(
'service_manager' => array(
'services' => array(
//'Auth' => new Sookon\Authentication\AuthenticationService(),
),
),
'controllers' => array(
'invokables' => array(
'Article\Controller\Index' => 'Article\Controller\IndexController',
'Article\Controller\Article' => 'Article\Controller\ArticleController',
'Article\Controller\Category' => 'Article\Controller\CategoryController',
),
),
'router' => array(
'routes' => array(
//通配路由
'article' => array(
'type' => 'Segment',
'options' => array(
'route' => '/article[/:controller[/:action[/page/:page][/id/:id]]]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'page' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
'module' => 'Article',
'__NAMESPACE__' => 'Article\Controller',
'controller' => 'Article\Controller\Index',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
'wildcard' => array(
'type' => 'Wildcard'
)
)
),
//新闻栏目
'news' => array(
'type' => 'Segment',
'options' => array(
'route' => '/news[/:category[/page/:page][[/:article].html]]',
'constraints' => array(
'category' => '[a-zA-Z][a-zA-Z0-9_-]*',
'page' => '[a-zA-Z][a-zA-Z0-9_-]*',
'article' => '.*',
),
'defaults' => array(
'module' => 'Article',
'__NAMESPACE__' => 'Article\Controller',
'controller' => 'Article\Controller\Category',
'action' => 'list',
),
),
'may_terminate' => true,
'child_routes' => array(
'wildcard' => array(
'type' => 'Wildcard'
)
)
),
),//routers
),
'view_manager' => array(
'template_path_stack' => array(
'article' => __DIR__ . '/../view',
),
'template_map' => array(
'layout/article/pagination' => __DIR__ . '/../view/layout/pagination-news.phtml',
'layout/article/news/page' => __DIR__ . '/../view/article/article/view.phtml',
'layout/article/news/index' => __DIR__ . '/../view/article/article/index.phtml',
),
),
);