我正在使用Yii的用户模块,我在配置文件视图中有另一个控制器的动作的renderPartial视图
<div class="row">
<?php $model2 = new Symptomhistory; ?>
<?php $this->renderPartial('//symptomhistory_usersHistory',array('model'=>$model2)); ?>
</div>
当我在本地服务器上运行它时,这段代码工作得很好,但是当我将它上传到我的主机时,我得到以下错误:
CException
ProfileController cannot find the requested view "//symptomhistoryusersHistory".
我试着用"....ect.."等. .viewssymptomhistory userhistory "也是,但它不起作用。是我的服务器有问题吗?因为如果它是,这是一个奇怪的,因为所有其他的renderPartials工作良好,它只是这个,它找不到。
感谢您的宝贵时间。
您可能在windows上运行xampp对吗?永远不要使用反斜杠作为路径分隔符,总是使用正斜杠。
所以你的命令应该是:<?php $this->renderPartial('//symptomhistory/_usersHistory', array('model' => $model2)); ?>