Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <?php
  2.  
  3. use yii\helpers\Html;
  4. use yii\helpers\Url;
  5. use yii\widgets\ActiveForm;
  6. use kartik\file\FileInput;
  7.  
  8. /* @var $this yii\web\View */
  9. /* @var $model common\models\Slider */
  10. /* @var $form yii\widgets\ActiveForm */
  11. ?>
  12.  
  13. <div class="slider-form">
  14.  
  15. <?php $form = ActiveForm::begin(); ?>
  16.  
  17. <?= $form->field($model, 'name_slider')->textInput(['maxlength' => true]) ?>
  18.  
  19. <h3>Image Slider</h3>
  20. <?= FileInput::widget([
  21. 'name' => 'image_slider',
  22. 'options'=>[
  23. 'multiple'=>true
  24. ],
  25. 'pluginOptions' => [
  26. 'uploadUrl' => Url::to(['/web/images/slider/']),
  27. 'uploadExtraData' => [
  28. 'album_id' => 20,
  29. 'cat_id' => 'Nature'
  30. ],
  31. 'maxFileCount' => 1
  32. ]
  33. ]); ?>
  34.  
  35. <h3>Image Discount</h3>
  36. <?= FileInput::widget([
  37. 'name' => 'image_diskon',
  38. 'options'=>[
  39. 'multiple'=>true
  40. ],
  41. 'pluginOptions' => [
  42. 'uploadUrl' => Url::to(['/web/images/slider/']),
  43. 'uploadExtraData' => [
  44. 'album_id' => 20,
  45. 'cat_id' => 'Nature'
  46. ],
  47. 'maxFileCount' => 1
  48. ]
  49. ]); ?>
  50.  
  51. <div class="form-group">
  52. <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  53. </div>
  54.  
  55. <?php ActiveForm::end(); ?>
  56.  
  57. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement