scieri
(Office)
September 27, 2014, 11:44am
#1
Hello Yii users,
I’ve been developing an new theme for Yii and I have the following issues:
When I generate with GII a new model, view it is stored in protected/views
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?
alirz23
(Alirz23)
September 27, 2014, 3:44pm
#2
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')
scieri
(Office)
September 28, 2014, 10:10am
#3
alirz23:
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.