【发布时间】:2015-10-07 19:21:34
【问题描述】:
我是 YII 的新手,我使用 Eclipse IDE 和 XAMPP 开发了一个 yii 应用程序。它在我的本地机器上的 Windows 平台上完美运行。但是当我将它部署到服务器时,它无法正常工作。
这是我的小部件控制器 "/protected/components/NotificationWidget.php"
<?php
class NotificationWidget extends CWidget {public function run() {
$notifications = Notification::model()->findAllByAttributes(array('Date'=>date('Y-m-d')));;
$this->render('/protected/components/Views/notification.php', array(
'notifications'=>$notifications
));
}}?>
这是我的观点
"/protected/components/视图"
<li class="dropdown notifications-menu">
<!-- Menu toggle button --> <a href="#" class="dropdown-toggle"
data-toggle="dropdown"> <i class="fa fa-bell-o"></i> <span
class="label label-warning"><?php echo sizeof($notifications);?></span> </a>
<ul class="dropdown-menu">
<li class="header">You have <?php echo sizeof($notifications);?>
notifications</li>
<li>
<!-- Inner Menu: contains the notifications -->
<ul class="menu">
<?php
foreach($notifications as $notification) {
echo "<li>".
"<a href='#'>".
" <i class='fa fa-users text-aqua'></i>". $notification->Description.
"</a></li>";
}
?>
</ul></li>
<li class="footer"><a href="#">View all</a>
</li>
</ul></li>
它给出以下错误。
NotificationWidget 找不到视图“/protected/components/Views/notification.php”。
任何人都可以帮助解决这个问题。
【问题讨论】: