Update table row using modal window

I display list of rows from table on update page, and I want to update each row one by one using Bootstrap modal. I’ve gone through this article but it didn’t work - http://www.yiiframework.com/wiki/806/render-form-in-popup-via-ajax-create-and-update-with-ajax-validation-also-load-any-page-via-ajax-yii-2-0-2-3/

Here is my current code:

Update View Code:


use yii\helpers\Html;

use yii\helpers\Url;

use yii\widgets\ActiveForm;

use yii\bootstrap\Modal;


<?php $form = ActiveForm::begin(); ?>

    <table class="table">









        <?php foreach($config as $index=>$value): ?>    


                <td><?= $value->type ?></td>

                <td><?= $value->size ?></td>


                    <?= Html::button('Edit', ['value' => Url::to(['site/update', 'id' => $value->id]), 'title' => 'Update Config', 'class' => 'btn btn-default update-btn']); ?>



        <?php endforeach; ?>



<?php ActiveForm::end(); ?>

Update Controller:

public function actionUpdate()


        $config = ProjectConfig::find()->where(['project_id' => 19])->all();

        return $this->render('update', [

            'config' => $config



And here is modal code:



    'headerOptions' => ['id' => 'modalHeader'],

    'id' => 'myModal',

    'size' => 'modal-lg',

    //keeps from closing modal with esc key or by clicking out of the modal.

    // user must click cancel or X to close

    'clientOptions' => ['backdrop' => 'static', 'keyboard' => FALSE]


echo Yii::$app->controller->renderPartial('_form');



How can I make the _form dynamic passing the model from controller.