Hello! I am trying to submit the form using pjax as it is written here http://www.yiiframework.com/wiki/772/pjax-on-activeform-and-gridview-yii2/

<?php Pjax::begin(['enablePushState' => false,'timeout' => 5000,'id' => 'pjax_form']); ?> <?php $form = ActiveForm::begin(['options' => ['data-pjax' => true],['enctype' => 'multipart/form-data'],'id' => 'dynamic-form']) ?> /*список полей*/ <?php ActiveForm::end(); ?> <?php Pjax::end(); ?> 

I get an error if I specify an attribute

['data-pjax' => true] - Setting unknown property: yii \ widgets \ ActiveForm :: 0

And if I don’t write, the page reloads when a button is pressed. Maybe someone came across, how can I fix this?

    1 answer 1

    Just the attribute is in the wrong place.

    It will be correct like this:

     $form = ActiveForm::begin(['options' => ['data-pjax' => true,'enctype' => 'multipart/form-data'],'id' => 'dynamic-form']);