Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calcio/f7c1ca85f80fce657fd3fa32aeb6f055 to your computer and use it in GitHub Desktop.
Save calcio/f7c1ca85f80fce657fd3fa32aeb6f055 to your computer and use it in GitHub Desktop.
Alteração do formulário de criação e alteração de Produtos
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\models\Product */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="product-form">
<?php $form = ActiveForm::begin(); ?>
<div class="row">
<div class="col-md-7">
<?= $form->field($model, 'category_id')->dropdownList(
$listCategories,
['prompt' => Yii::t('app', 'Select an item')]);
?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'price')->textInput(['maxlength' => true]) ?>
</div>
<div class="col-xs-1">&nbsp;</div>
<div class="col-md-3">
<?= $form->field($model, 'cover')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'highligt')->radioList($model->getStatusHighlighted())->label('Highlighted?') ?>
<hr />
<?= $form->field($model, 'status')->radioList($model->getStatusItems()) ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', '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