Dynamic action to pretty url




<?php

$this->widget('zii.widgets.CMenu', array(

'items' => array(

      array('label' => 'Home', 'url' => array('/site/home'), 'items' => array(

      array('label' => 'Homesub1', 'url' => array('/site/home', 'view' => 'homesub1')),

      array('label' => 'Homesub2', 'url' => array('/site/home', 'view' => 'homesub2')),

      )),

      array('label' => 'News', 'url' => array('/site/news')),

      array('label' => 'Content', 'url' => array('/site/content'), 'items' => array(

      array('label' => 'Content1', 'url' => array('/site/content', 'view' => 'content1')),

      array('label' => 'Content2', 'url' => array('/site/content', 'view' => 'content2')),

      array('label' => 'Content3', 'url' => array('/site/content', 'view' => 'content3')),

      )),

),

));

?>



I would like to pretty url:

domain

domain/home

domain/home/homesub1

domain/home/homesub1

domain/news

domain/content

domain/content/content1

domain/content/content2

domain/content/content3

etc…

How i config main with error handling?

if:

action wrong call index action

view wrong call action

domain/sdadsa '=>‘index’

domain/content/content4000000 '=>‘content’


		

'urlManager'=>array(

			'urlFormat'=>'path',

                        'showScriptName'=>false,

                        'caseSensitive' =>false,

			'rules'=>array(

                            

                        ? '<controller:[\w\-]+>/<action:[\w\-]+>/<view:\d+>'=>'site/index', ?


			),

		),



pls :frowning: