php - yii要配置出这样一个url,需要怎么定义路由规则?
巴扎黑
巴扎黑 2017-04-10 15:00:24
0
1
287

我现在想要配置出这样一个url,需要怎么定义路由规则?
news/<alias>/list-<page>.html
<alias>代表唯一的分类别名。
<page>代表分页的页码。
现在做了这样的配置:

'rules'=>array(
    'index'=>'site/index',
    'all' =>'house/base/index',
    'news/<alias:\w+>/index'=>'news/list',
    'news/list/<alias:\w+>-<page:\d+>'=>'news/list',
    #'news/<alias:\w+>/page/<page:\d+>'=>'news/list',
    #'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
    #'<controller:\w+>/<action:\w+>'=>'>controller>/<action>',
),
巴扎黑
巴扎黑

모든 응답(1)
巴扎黑
'/news/<alias:\w+>/list-<page:\d+>'=>'/news/list'
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!