$.post( "' . Url::to(['//task/exersicespreview', 'list' => '']) . '"+arr, function( data ) { $( "#exersicespreview" ).html( data ); }); '], 'pluginOptions' => ['tags' => true]]); ?> <?php echo Html::tag('br'); ?> <div class="panel panel-default"> <div class='panel-heading'>Список упражнений</div> <div class='panel-body' id="exersicespreview" ><?php $list = ArrayHelper::getColumn($model->exercises, 'exercise.id'); $exersices = \common\models\Exercise::findAll($list); echo $this->render('/task/_exersicespreview', ['exersices' => $exersices]); ?> </div> </div> <?php //= $form->field($model, 'student_id')->listBox(TaskType::typeList(),['onchange' => '$.pjax.reload({container: "#form-give-task"});']) ?> <?php //= $form->field($model, 'text')->textarea(['rows' => 6]) ?> <div class="form-group">
public function actionExersicespreview($list) { $list = GivenTask::listToArray($list); $exersices = \common\models\Exercise::findAll($list); return $this->renderAjax('_exersicespreview', ['exersices' => $exersices]); }