Skip to content

Instantly share code, notes, and snippets.

@evercode1
Last active October 2, 2015 09:42
Show Gist options
  • Select an option

  • Save evercode1/7985ba8bfcd58cfb8b3c to your computer and use it in GitHub Desktop.

Select an option

Save evercode1/7985ba8bfcd58cfb8b3c to your computer and use it in GitHub Desktop.
form partial profile chap 8
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/**
* @var yii\web\View $this
* @var app\models\Profile $model
* @var yii\widgets\ActiveForm $form
*/
?>
<div class="profile-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'first_name')->textInput(['maxlength' => 45]) ?>
<?= $form->field($model, 'last_name')->textInput(['maxlength' => 45]) ?>
<br>
<?= $form->field($model, 'birthdate')->textInput() ?>
* please use YYYY-MM-DD format
<br>
<?= $form->field($model, 'gender_id')->dropDownList($model->genderList, ['prompt' => 'Please Choose One' ]);?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update',
['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment