Skip to content

Instantly share code, notes, and snippets.

@DrMabuse23
Last active August 29, 2015 14:05
Show Gist options
  • Save DrMabuse23/1472a6d39fbcd351f1b5 to your computer and use it in GitHub Desktop.
Save DrMabuse23/1472a6d39fbcd351f1b5 to your computer and use it in GitHub Desktop.
my trys to use the resatpai with activeform
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model \common\models\base\MagazineBase */
/* @var $form ActiveForm */
?>
<div class="form_magazine">
<?php $form = ActiveForm::begin([
'action' => \yii\helpers\Url::to(['/api/magazine-api/create']),
'enableAjaxValidation' => true,
'method' => 'POST',
'validateOnChange' => false,
'ajaxDataType' => 'application/x-www-form-urlencoded'
]); ?>
<?= $form->field($model, 'default_title') ?>
<?= $form->field($model, 'language_id')->dropDownList(
\yii\helpers\ArrayHelper::map(\common\models\ps1base\Language::find()->all(),'id','default_title'),
['prompt'=>'Choose...']
); ?>
<?= $form->field($model, 'hostname')->input('url') ?>
<?= $form->field($model, 'color') ?>
<?= $form->field($model, 'icon_file_id') ?>
<?= $form->field($model, 'file_id') ?>
<?= Html::activeHiddenInput($model, 'user_id') ?>
<?= Html::activeHiddenInput($model, 'updated_at') ?>
<?= Html::activeHiddenInput($model, 'created_at') ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('app', 'Submit'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div><!-- _form_magazine -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment