0
我想創建一個名爲'IssueList'的自定義小部件,它將擴展'ListView'。使用自定義itemView在自定義小部件中放置小部件yii2
<?php
namespace frontend\components;
use yii\base\Widget;
use yii\widgets\ListView;
class IssueList extends Widget{
public $dataProvider;
public function init(){
parent::init();
}
public function run(){
return ListView::widget([
'dataProvider' => $this->dataProvider,
'itemOptions' => [
'class' => 'item issue-item'
],
'options' => [
'class' => 'issue_list'
],
'itemView' => '_issueListView',
'layout' => '{items}{pager}',
]);
}
}?>
但是,ListView有一個自定義itemView。當渲染插件我得到這個錯誤
視圖文件不存在:
/var/www/clients/client1/web1/frontend/views/comments/_issueListView.php
它顯然期待在錯誤的目錄中,我該如何改變它?