HOW TO USE ABSOLUTE URL AS FORM ACTION

Am working with Yii2. been enjoying it, but now I have a challenge. I want to create an Active Form with an absolute URL as the action.

I tried:

 <?php $form = ActiveForm::begin([


         'id' => 'activeform9',


         'action' => ['http://www.mysite.com/index.php?r=biologyans/welcome&b=1234'],


         'enableAjaxValidation' => false,


        // 'enableClientValidation' => true,


       //  'class'=>'form-horizontal'


         'ajaxDataType' => 'json',


         'ajaxParam' => 'ajax',


         'enableClientValidation' => false





]); ?>  

But when I submit via AJAX I get 404 page not found.

it is looking for:


http://127.0.0.1/index.php?r=http://www.mysite.com/index.php?r=biologyans/welcome&b=1234

Please any helps will be greatly useful!

‘action’ property of ActiveForm is a string or an array that is to be processed by yii\helpers\Url::to().

http://www.yiiframework.com/doc-2.0/yii-widgets-activeform.html#$action-detail

Html::to()

So you had to use a string here:




'action' => 'http://www.mysite.com/index.php?r=biologyans/welcome&b=1234',