Advertisement
pmtpenza22

Untitled

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