'urlManager' => array(
'urlFormat' => 'path',
'rules' => array(
'<controller:\w+>/<id:\d+>' => '<controller>/view',
//'<controller:\w+>/<view:\w+>' => '<controller>/page',
),
'showScriptName' => false,
),
'<link:[\w\-]+>' => 'site/post',
public function actionPost()
{
$link = Yii::app()->request->getParam('link');
if ($link == null)
{
throw new CHttpException(404, 'The requested page does not exist.');
}
$post = Post::model()->findByAttributes(array('link' => $link));
if ($post == null)
{
throw new CHttpException(404, 'The requested page does not exist.');
}
$this->render('post', array(
'model' => $post
));
}