New Theme Questions

Hello Yii users,

I’ve been developing an new theme for Yii and I have the following issues:

  1. When I generate with GII a new model, view it is stored in protected/views

  2. My theme is stored in theme folder outside protected directory.

How can I display into theme/mytheme/site/index.php view an view that is generated into protected/views/…?

Also I’ve tried


$this->render('myview/index')

but I only get and error


SiteController cannot find the requested view "myview/index". 

. My question is where is the render command searching for the view file into theme or protected? and how can be set to search only on theme folder?

generate the views and controller once you are done just move the view files under theme/views folder, make sure to set your theme in config/main.php like so




// protected/config/main.php

...

'theme' => 'mytheme',

...


// in you controller you just can pass in the name of the file


$this->render('index') 




Thank you for the reply, I though that was the solution.