Hi folks, new user here.
I understand my views follow the /protected/views/ControllerName/ActionName convention. My TreeController’s actions were resolved without an issue under /protected/views/tree.
In an attempt to mimic the web app generated by yiic, I made a base controller in the /protected/components directory called ArboretumController and started to subclass it instead of CController.
I then got errors telling me Yii could not find TreeController’s views, so I assumed that Yii started to look under a views subdirectory in /protected/components. However, duping the views did not help. These are the paths I’ve tried to put my views in:
/protected/views/tree
/protected/views/arboretum/tree
/protected/components/views/tree
/protected/components/views/arboretum/tree
I have also tried overriding CController::getViewPath(), which did not help.
I can solve this problem myself if I knew how to dump the variables Yii is using before the error is encountered.
Where is Yii looking for my views? I have checked the docs and forums, but the information I found has not helped me solve my problem.
<?php
class ArboretumController extends CController {
// anon sessions ok
protected $session;
public function __construct() {
$this->session = new CHttpSession;
$this->session->open();
}
}
<?php
class TreeController extends ArboretumController
{
public function __construct()
{
parent::__construct();
}
public function actionIndex($page = 'index')
{
/*
To avoid a fat controller with one action set for each
possible page of a session-based stateful form,
we select the form view based on a seperate GET argument
outside of the route.
*/
$this->beginContent();
$this->beginWidget('PagedFormWidget', array(
'session' => $this->session
));
$this->renderPartial($page);
$this->endWidget();
$this->endContent();
}
}