未定義の変数のヘルプが必要です:yii2のdataProvider 私はkartik gridview extensionをインストールしました。 私はYII2の新作です。 グリッドを作成しようとしています。 助けてください。未定義の変数:yii2のdataProvider
取得後のエラー
ここ
PHPのお知らせ - Yiiの\ベースの\ ErrorException 未定義の変数:dataProviderの
は
echo GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => $gridColumns,
'containerOptions' => ['style'=>'overflow: auto'], // only set when $responsive = false
'beforeHeader'=>[
[
'columns'=>[
['content'=>'Header Before 1', 'options'=>['colspan'=>4, 'class'=>'text-center warning']],
['content'=>'Header Before 2', 'options'=>['colspan'=>4, 'class'=>'text-center warning']],
['content'=>'Header Before 3', 'options'=>['colspan'=>3, 'class'=>'text-center warning']],
],
'options'=>['class'=>'skip-export'] // remove this row from export
]
],
'toolbar' => [
['content'=>
Html::button('<i class="glyphicon glyphicon-plus"></i>', ['type'=>'button', 'title'=>Yii::t('kvgrid', 'Add Book'), 'class'=>'btn btn-success', 'onclick'=>'alert("This will launch the book creation form.\n\nDisabled for this demo!");']) . ' '.
Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['grid-demo'], ['data-pjax'=>0, 'class' => 'btn btn-default', 'title'=>Yii::t('kvgrid', 'Reset Grid')])
],
'{export}',
'{toggleData}'
],
'pjax' => true,
'bordered' => true,
'striped' => false,
'condensed' => false,
'responsive' => true,
'hover' => true,
'floatHeader' => true,
'floatHeaderOptions' => ['scrollingTop' => $scrollingTop],
'showPageSummary' => true,
'panel' => [
'type' => GridView::TYPE_PRIMARY
],
]);
あなたのフルコードを投稿してください。 – GAMITG
質問に含めるのを忘れたコードを*編集*する必要があります。答えとして投稿することはできません。私はそれを行うのに十分な意味がありません。 – Flexo
@ Flexo♦:私はちょうどstackoverflowを使用し始めました。私はルールに恵まれていませんでした。今私は質問と回答、編集などの投稿に関するすべてを学んだが、残念ながら私はブロックされており、今度は新しい質問 を投稿できず、次のエラーが表示されない。 あなたの質問の上限に達しました 申し訳ありません、このアカウントからの質問はもう受け付けておりません。詳細については、ヘルプセンターをご覧ください。 この禁止を解除する方法を教えてください。 私は既に投稿されたすべての質問を編集していました。 –