Kartik' yii2-grid:设置未知属性:kartik \ grid \ GridView :: panel

时间:2016-09-11 13:02:12

标签: gridview yii2 panel

对于我的生活,我在使用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'],

            [...]

但是,hoverpersistResize可以正常工作。

我的composer.json也包含:

&#13;
&#13;
    "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;
&#13;
&#13;

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

似乎您在属性'panel '

中有空白
 'panel ' => [
        'heading'=>'<h1>'.Html::encode(mb_strtoupper($this->title)).'</h1>', 
    ],

尝试删除它

   'panel' => [
        'heading'=>'<h1>'.Html::encode(mb_strtoupper($this->title)).'</h1>', 
    ],