|
- <?php
-
- use yii\helpers\Html;
- use yii\widgets\ActiveForm;
-
- /* @var $this yii\web\View */
- /* @var $model app\models\Produit */
- /* @var $form yii\widgets\ActiveForm */
- ?>
-
- <div class="produit-form">
-
- <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
-
- <?= $form->field($model, 'actif')->radioList([1 => 'Oui',0 => 'Non' ]) ?>
- <?= $form->field($model, 'order')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'nom')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'diminutif')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?>
- <?= $form->field($model, 'prix')->textInput() ?>
- <?= $form->field($model, 'epuise')->checkbox() ?>
- <?= $form->field($model, 'photo')->fileInput() ?>
- <?php
- if(strlen($model->photo)) {
- echo '<img src="../../frontend/web/uploads/'.$model->photo.'" width="200px" /><br />' ;
- echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />' ;
- }
- ?>
-
- <div class="form-group">
- <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
- </div>
-
- <?php ActiveForm::end(); ?>
-
- </div>
|