I've this rule in my config
'<category:[a-zA-Z0-9_-]+>/<news:[a-zA-Z0-9_-]+>'=>'news/full'
it is possible to make rules like this 'backend/' => 'backend/ ' ?
i mean to make link like http://localhost/backend/portlets respond to backend controller and not to news category. I know that i can make rule like
'backend/protlets' => 'backend/portlets', but i've many backend actions… i don't want to describe all actions in url config.
hung5s
(Hung5s)
March 10, 2009, 10:45am
2
Yii 1.0.3 support control path using / so there is no need to configure your routes. Just create a controllers/backend folder in you app
ok, some urls are working only because they doesn't match any rules.
here is my urlconf
'urlFormat'=>'path',
'urlSuffix'=>'.html',
'showScriptName'=>false,
'rules'=>array(
''=>'news/list',
'login'=>'users/login',
'registration'=>'users/registration',
'users/<user:[a-zA-Z0-9_-]+>'=>'users/detail',
'archive/<day:d{2}><month:d{2}><year:d{4}>'=>'news/archive',
'<category:[a-zA-Z0-9_-]+>'=>'news/category',
'<category:[a-zA-Z0-9_-]+>/<news:[a-zA-Z0-9_-]+>'=>'news/full',
'<category:[a-zA-Z0-9_-]+>/<news:[a-zA-Z0-9_-]+>/add'=>'comments/create'
)
i've module backend, it has controller Portlets. And the is an action - Notes.
so - url localhost/backend/portlets/notes - works fine.
but if i've localhost/backend/portlets - it is responding to this rule ('<category:[a-zA-Z0-9_-]+>/<news:[a-zA-Z0-9_-]+>'=>'news/full')
qiang
(Qiang Xue)
March 10, 2009, 11:53am
4
that means your rule design has problem because it is true that localhost/backend/portlets can be considered as a news category according to your rule set. You need some way to differentiate it.