Example #1
0
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use app\models\Tipo;
/* @var $this yii\web\View */
/* @var $model app\models\Puertos */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="puertos-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo Html::activeDropDownList($model, 'tipo', ArrayHelper::map(Tipo::getTypes(), 'id', 'name'), ['class' => 'form-control']);
?>

    <?php 
echo $form->field($model, 'nombre')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'ubicacion')->textInput(['maxlength' => true]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>