Tôi cần một quy tắc cho http://example.com/post/view/id/1 url sẽ được hiển thị như thế này http://example.com/post/post_title. Thay vì số id tôi muốn hiển thị tên bài đăng hoặc tiêu đề.Url thân thiện với SEO trong Yii
cấu hình của tôi trông như thế này:
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
//'<controller:\w+>/<id:\d+>'=>'<controller>/view',
//'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
//'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
'showScriptName'=>false,
),
Chấp nhận một câu trả lời xin vui lòng. –