Url Manager

(with google translate…)

Greetings …

I’m making the site an organization that has a lot of departments where the departemen will be able to manage his own content …

url address is made as follows:

http://domain.com/deptone

refers to the controller => main, action => index, deptid = 1

http://domain.com/depttwo

refers to the controller => main, action => index, deptid = 2

http://domain.com/deptone/read

refers to the controller => main, action => read, deptid = 1

http://domain.com/depttwo/read

refers to the controller => main, action => read, deptid = 2

When using CodeIgniter I make a route as follows:

route ["deptone"] = "/ main/index/1";

route ["depttwo"] = "/ main/index/2";

route ["deptone/read/(:any)"] = "/main/read/1";

route ["depttwo/read/(:any)"] = "/main/read/2";

where 1 and 2 is the id of each departement (from departemen model). id will be used as the WHERE condition in the query.

Ok …

Somebody who had studied ci certainly know that to read 1 and 2 we use $this->uri-rsegment(3) and read any parameter using $this->uri-segment(n).

How to create a route like this in Yii (UrlManager) and how read 1 and 2 …?

Thank you for the answer will be given …

There is no better answer than Guide… http://www.yiiframework.com/doc/guide/1.1/en/topics.url