Advertisement
pmtpenza22

Untitled

Feb 13th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. <?php
  2.  
  3. use yii\helpers\Html;
  4. use yii\widgets\ActiveForm;
  5. use common\models\User;
  6. use mihaildev\ckeditor\CKEditor;
  7. use kartik\file\FileInput;
  8. use yii\web\NotFoundHttpException;
  9. use yii\web\Controller;
  10. use yii\helpers\FileHelper;
  11. use yii\helpers\Url;
  12. use yii\web\UploadedFile;
  13. use \yii\helpers\VarDumper;
  14.  
  15.  
  16. /* @var $this yii\web\View */
  17. /* @var $model backend\models\Product */
  18. /* @var $form yii\widgets\ActiveForm */
  19. ?>
  20.  
  21. <div class="product-form">
  22.  
  23. <?php $form = ActiveForm::begin([
  24. 'options'=>['enctype'=>'multipart/form-data'],
  25. ]); ?>
  26.  
  27. <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
  28.  
  29. <?= $form->field($model, 'price_roz')->textInput(['maxlength' => true]) ?>
  30. <?php foreach ($images as $image) {
  31. \yii\helpers\VarDumper::dump($image, 10, true);
  32. } ?>
  33. <?= $form->field($model, 'price_opt')->textInput(['maxlength' => true]) ?>
  34.  
  35. <?= $form->field($model, 'category_id')->textInput() ?>
  36.  
  37. <?php echo $form->field($model, 'status')->dropDownList(User::statuses()) ?>
  38.  
  39. <?= \kartik\file\FileInput::widget([
  40. 'name' => 'ImagesManager[attachment]',
  41. 'options'=>[
  42. 'multiple'=>true
  43. ],
  44. 'pluginOptions' => [
  45. 'uploadUrl' => 'http://localhost/mobile-go/backend/web/index.php?r=site/save-img',
  46. 'uploadExtraData' => [
  47. 'ImagesManager[class]' => $model->formName(),
  48. 'ImagesManager[product_id]' => $model->id
  49. ],
  50. 'maxFileCount' => 10
  51. ]
  52. ]);
  53. ?>
  54.  
  55. <?php echo $form->field($model, 'description')->widget(CKEditor::className(),[
  56. 'editorOptions' => [
  57. 'preset' => 'full', //разработанны стандартные настройки basic, standard, full данную возможность не обязательно использовать
  58. 'inline' => false, //по умолчанию false
  59. ],
  60. ]); ?>
  61.  
  62. <?= $form->field($model, 'meta_title')->textInput() ?>
  63.  
  64. <?= $form->field($model, 'meta_keyword')->textInput(['maxlength' => true]) ?>
  65.  
  66. <?= $form->field($model, 'meta_description')->textInput(['maxlength' => true]) ?>
  67.  
  68. <?= $form->field($model, 'hit')->checkbox(['0','1']) ?>
  69.  
  70. <?= $form->field($model, 'new')->checkbox(['0','1']) ?>
  71.  
  72. <?= $form->field($model, 'sale')->checkbox(['0','1']) ?>
  73.  
  74. <div class="form-group">
  75. <?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
  76. </div>
  77.  
  78. <?php ActiveForm::end(); ?>
  79. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement