对于我的生活,我在使用Kartik的yii2-grid时无法排除以下错误:
设置未知属性:kartik \ grid \ GridView :: panel
我的代码是:
use yii\helpers\Html;
use kartik\grid\GridView;
[...]
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'hover' => true,
'persistResize' => true,
'pager' => [
'firstPageLabel' => Yii::t('app', 'Inicio'),
'lastPageLabel' => Yii::t('app', 'Final'),
'maxButtonCount' => Yii::$app->params['numBotones'],
],
'panel ' => [
'heading'=>'<h1>'.Html::encode(mb_strtoupper($this->title)).'</h1>',
],
'columns' => [
['class' => 'kartik\grid\SerialColumn'],
[...]
但是,hover
和persistResize
可以正常工作。
我的composer.json
也包含:
"minimum-stability": "stable",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "*",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*",
"yiisoft/yii2-jui": "*",
"kartik-v/yii2-grid": "@dev",
"kartik-v/yii2-mpdf": "@dev",
"kartik-v/yii2-widgets": "*",
"2amigos/yii2-tinymce-widget" : "*",
"sjaakp/yii2-illustrated-behavior": "*",
"dektrium/yii2-user": "0.9.*@dev",
"dektrium/yii2-rbac": "1.0.0-alpha@dev"
},
&#13;
有什么想法吗?
答案 0 :(得分:1)
似乎您在属性'panel '
'panel ' => [
'heading'=>'<h1>'.Html::encode(mb_strtoupper($this->title)).'</h1>',
],
尝试删除它
'panel' => [
'heading'=>'<h1>'.Html::encode(mb_strtoupper($this->title)).'</h1>',
],