I have a controller (Admin/Management/UserController.php). This Controller is in a sub-sub directory and I want to call a view (Sites/User.php) which does not belong to the dirctory of the controllerID.
I’m sorry that the reply took so long. But here is the whole error message I get. It is a diffrent controller but the same problem.
CException
SiteController cannot find the requested view "application.views.sites.contact".
E:\wamp\www\ekc\framework\web\CController.php(878)
866 {
867 if(($viewFile=$this->getViewFile($view))!==false)
868 {
869 $output=$this->renderFile($viewFile,$data,true);
870 if($processOutput)
871 $output=$this->processOutput($output);
872 if($return)
873 return $output;
874 else
875 echo $output;
876 }
877 else
878 throw new CException(Yii::t('yii','{controller} cannot find the requested view "{view}".',
879 array('{controller}'=>get_class($this), '{view}'=>$view)));
880 }
881
882 /**
883 * Renders a named clip with the supplied parameters.
884 * This is similar to directly accessing the {@link clips} property.
885 * The main difference is that it can take an array of named parameters
886 * which will replace the corresponding placeholders in the clip.
887 * @param string $name the name of the clip
888 * @param array $params an array of named parameters (name=>value) that should replace
889 * their corresponding placeholders in the clip
890 * @param boolean $return whether to return the clip content or echo it.
Stack Trace
#0
+
E:\wamp\www\ekc\framework\web\CController.php(782): CController->renderPartial("application.views.sites.contact", array("model" => ContactiForm), true)
#1
+
E:\wamp\www\ekc\eRouting\protected\controllers\admin\home\SiteController.php(75): CController->render("application.views.sites.contact", array("model" => ContactiForm))
#2
+
E:\wamp\www\ekc\framework\web\actions\CInlineAction.php(49): SiteController->actionContact()
#3
+
E:\wamp\www\ekc\framework\web\CController.php(308): CInlineAction->runWithParams(array("r" => "admin/home/site/contact"))
#4
+
E:\wamp\www\ekc\framework\web\CController.php(286): CController->runAction(CInlineAction)
#5
+
E:\wamp\www\ekc\framework\web\CController.php(265): CController->runActionWithFilters(CInlineAction, array())
#6
+
E:\wamp\www\ekc\framework\web\CWebApplication.php(282): CController->run("contact")
#7
+
E:\wamp\www\ekc\framework\web\CWebApplication.php(141): CWebApplication->runController("admin/home/site/contact")
#8
+
E:\wamp\www\ekc\framework\base\CApplication.php(169): CWebApplication->processRequest()
#9
–
E:\wamp\www\ekc\eRouting\index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2013-05-27 15:20:08 Apache/2.2.22 (Win64) PHP/5.4.3 Yii Framework/1.1.13
Something’s amiss here. Your first post’s directory structure says that the user view file is named User.php but you’re calling it with a lower case. Yii’s default code uses lowercase file names for views. Go through and make sure all directories’ and files’ case match what you’re calling in your render methods.
it was an error in my first report. I will change this. Thanks.
I named all views in lower case and call they this way.
Yes I am using the bootstrap theme. But alle my views are in the standard direcotry and it works (only the call of a view in a parent directory doesn’t work)
According to this, if you’re using a theme it will call CTheme’s getViewFile which will look in the current theme’s (or module’s if appropriate) views directory. Not sure if this applies here though.
Do me a favor and disable the theme in your main config and see if Yii can find the views.