You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_form.php 1.3KB

8 jaren geleden
123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\ActiveForm;
  4. /* @var $this yii\web\View */
  5. /* @var $model app\models\Produit */
  6. /* @var $form yii\widgets\ActiveForm */
  7. ?>
  8. <div class="produit-form">
  9. <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
  10. <?= $form->field($model, 'actif')->radioList([1 => 'Oui',0 => 'Non' ]) ?>
  11. <?= $form->field($model, 'order')->textInput(['maxlength' => 255]) ?>
  12. <?= $form->field($model, 'nom')->textInput(['maxlength' => 255]) ?>
  13. <?= $form->field($model, 'diminutif')->textInput(['maxlength' => 255]) ?>
  14. <?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?>
  15. <?= $form->field($model, 'prix')->textInput() ?>
  16. <?= $form->field($model, 'epuise')->checkbox() ?>
  17. <?= $form->field($model, 'photo')->fileInput() ?>
  18. <?php
  19. if(strlen($model->photo)) {
  20. echo '<img src="../../frontend/web/uploads/'.$model->photo.'" width="200px" /><br />' ;
  21. echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />' ;
  22. }
  23. ?>
  24. <div class="form-group">
  25. <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  26. </div>
  27. <?php ActiveForm::end(); ?>
  28. </div>