yii portlet无法呈现视图

时间:2014-01-24 11:20:08

标签: php yii

我的portlet无法呈现视图;

这就是我称之为portlet的方式:

$this->widget('ModalConfirmDelete', array(
    'type_domain_or_url' => 'domain',
));

这是我的portlet:

<?php

class ModalConfirmDelete extends CPortlet {

    public $type_domain_or_url;

    public function init() {
        parent::init();
    }

    /**
     * Renders the content of the portlet.
     */
    protected function renderContent() {
        $this->render(dirname(__FILE__) . '/views/modal_confirm_delete', array(
            'type_domain_or_url' => $this->type_domain_or_url,
        ));
    }

}

视图位于与portlet相同的目录下,但位于views子文件夹中;

为什么我会得到例外?

CException

ModalConfirmDelete cannot find the view "/var/www/html/HeadQuarter/frontend/protected/portlets/views/modal_confirm_delete"

1 个答案:

答案 0 :(得分:1)

解决;由于某种原因,不需要路径;

我刚写了视图名称;

在其他项目中,我必须指定路径;

相关问题