Site Pages Controller

Hi at all…

I have a problem… How can I create a controller for the pages that there are in the site directory?

/home/username/workspace/testdrive/protected/views/site/contact.php

/home/username/workspace/testdrive/protected/views/site/error.php

/home/username/workspace/testdrive/protected/views/site/index.php

/home/username/workspace/testdrive/protected/views/site/login.php

How can I do it?

Thank you…

There should be a SiteController already that uses those views.

I invite you to read the official guide.

Hi!

Thanks…

I know about SiteController… but I thought I shouldn’t touch it… I don’t know why…

I have read a lot… but is difficult for me now…

Also, Yii presented a tools, named Gii. It is used for generating model, controller, CRUD and modules in Yii too easy.

You can copy/rename the default controller and copy its views.

You can also change default controller to this copy of yours (instead of site).