Theming, views not found

hello,

i try to put my views and layout files into the theme directory. but after i copied the files and setup the config in the main.php it is not working anymore.

below you will find the details.

ERROR:

IndexController cannot find the requested view "index".

main.php

        'Theme'=>array(


                'basePath'=>'/home/projects/daytrip.dev/public_html/themes',


                'name'=>'daytrip',


        ),

folder structure



.


|-- private_html


|   `-- application


|       |-- commands


|       |   `-- shell


|       |-- components


|       |   `-- views


|       |-- config


|       |-- controllers


|       |   `-- index


|       |-- extensions


|       |-- messages


|       |-- models


|       `-- runtime


`-- public_html


    |-- assets


    `-- themes


        `-- daytrip


            `-- views


                |-- index


                |-- layouts


                |-- site


                `-- system


indexController.php



        //render view


        $this->controller->render('index', array('countries' => $rows, 'pages' => $pages, 'sort' => $sort));


Do you have index.php under index directory in your theme?

no the index.php is in the public_html.

Since you are calling render('index'), you should have a view file named index.php under protected/views/<ControllerID>/ or under the corresponding theme directory.

Quote

Since you are calling render('index'), you should have a view file named index.php under protected/views/<ControllerID>/ or under the corresponding theme directory.

sorry i was sleeping, i thought you mean the index.php (bootstrap file).

below the structure with files.



.


|-- assets


|-- css


|   |-- admin.css


|   |-- bg.gif


|   |-- form.css


|   `-- main.css


|-- images


|   `-- nl.jpg


|-- index.php


`-- themes


    `-- daytrip


        `-- views


            |-- index


            |   `-- index.php


            |-- layouts


            |   `-- main.php


            |-- site


            `-- system


What if you don't set theme? Does it still have error?

Quote

What if you don't set theme? Does it still have error?

still: IndexController cannot find the requested view "index".

all the views and layout file are in public_html/themes/daytrip/views/<ControllerID>/*.php

Do you have protected/views/index/index.php ? If you don't set 'theme' property in app config, you will need this file to render('index').

Quote

Do you have protected/views/index/index.php ? If you don't set 'theme' property in app config, you will need this file to render('index').

ok, one sec.

i thought when you set a theme you have to move all the view files to the theme directory.

so what I did is set the theme to daytrip in the app config put all the view files in public_html/themes/daytrip/views/<ControllerID>/*.php and move die layout.php to public_html/themes/daytrip/views/layout/layout.php

but that is not working… so how do i need to setup theming in Yii…?

Sorry, I didn't pay attention to your app config. It is incorrect. You just need "theme"=>"daytrip" at the top level of the config array.