我正在使用Yii2模態更新模態窗口中的窗體,但我無法獲取已在表單中填充的值。Yii2:獲取值以在模態窗口中更新表格
在下面這個屏幕截圖鏈接:
http://awesomescreenshot.com/0f957qq367
當我點擊編輯選項,這需要我這是在一個模態窗口中打開更新的形式。但是這種形式在所有領域顯示出空白的價值。我想更新表格。
http://awesomescreenshot.com/0f257qqscb
這是我所試過沒片斷:
<?php
use yii\bootstrap\Nav;
use yii\bootstrap\Modal;
Modal::begin([
'id'=>'modalEdit',
//'header' => '<h2>Hello world</h2>',
'size'=> 'modal-lg',
//'toggleButton' => ['label' => 'click me'],
]);
$newmodel = new Backlog();
// $newmodel->id;
echo $this->render('/backlog/update', ['model' => $newmodel]);
Modal::end();
echo Nav::widget([
'options' => ['class' => 'nav-pills navbar-right'],
'encodeLabels' => false,
'items' => [
['label' => '', 'items' => [
['label' => '<span data-toggle="modal" data-target="#modalEdit" style="cursor: pointer;">Edit</span>','url' => 'javascript:void(0);'],
'<li class="divider"></li>',
['label' => '<span>Assign</span>', 'url' => ['#']],
'<li class="divider"></li>',
['label' => '<span>Convert To Backlog</span>', 'url' => ['#']],
'<li class="divider"></li>',
['label' => '<span>Close</span>', 'url' => ['#']],
]],
],
]);
這不起作用。這給出了錯誤:調用成員函數getActiveValidators()null –