Exemplo n.º 1
2
 /**
  * Render the text area input
  */
 protected function renderInput()
 {
     if ($this->hasModel()) {
         $input = Html::activeTextArea($this->model, $this->attribute, $this->options);
     } else {
         $input = Html::textArea($this->name, $this->value, $this->options);
     }
     return $input;
 }
Exemplo n.º 2
1
                        <?php 
echo Html::activeInput('email', $commentForm, 'mail', ['placeholder' => 'Your email', 'class' => 'form-control']);
?>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <?php 
echo Html::activeTextInput($commentForm, 'username', ['placeholder' => 'Your username', 'class' => 'form-control']);
?>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <?php 
echo Html::activeTextArea($commentForm, 'content', ['placeholder' => 'Your comment', 'class' => 'form-control']);
?>
                </div>
            <div class="form-group">
                <?php 
echo Html::submitButton('Submit', ['class' => 'btn btn-primary']);
?>
            </div>
        <?php 
echo Html::endForm();
?>

        <h3><?php 
echo count($comments);
?>
 Commentaires</h3>
Exemplo n.º 3
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     if ($this->hasModel()) {
         echo Html::activeTextArea($this->model, $this->attribute, $this->options);
     } else {
         echo Html::textArea($this->name, $this->value, $this->options);
     }
     $this->registerClientScript();
 }
Exemplo n.º 4
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     MarkdownAsset::register($this->view);
     $this->registerScripts();
     $this->options['id'] = $this->id;
     if ($this->hasModel()) {
         echo Html::activeTextArea($this->model, $this->attribute, $this->options);
     } else {
         echo Html::textArea($this->name, $this->value, $this->options);
     }
 }
 public function run()
 {
     LeptureEditorAsset::register($this->view);
     $this->registerScripts();
     $this->options['id'] = $this->id;
     if ($this->hasModel()) {
         $textarea = Html::activeTextArea($this->model, $this->attribute, $this->options);
     } else {
         $textarea = Html::textArea($this->name, $this->value, $this->options);
     }
     echo '<div class="lepture">' . $textarea . '</div>';
 }
Exemplo n.º 6
0
 public function tinymce($options = [])
 {
     $htmlOptions = isset($options['htmlOptions']) ? $options['htmlOptions'] : [];
     $htmlOptions = array_merge($this->inputOptions, $htmlOptions);
     $this->adjustLabelFor($hmtlOptions);
     $this->parts['{input}'] = Html::activeTextArea($this->model, $this->attribute, $htmlOptions);
     $id = Html::getInputId($this->model, $this->attribute);
     $params = \yii\helpers\ArrayHelper::merge(["selector" => "#" . $id, "theme" => "modern", "plugins" => ["advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "emoticons template paste textcolor"], "external_plugins" => ["jbimages" => "/js/tinymce/plugins/jbimages/plugin.js", "placeholder" => "/js/tinymce/plugins/placeholder/plugin.js"], "convert_newlines_to_brs" => false, "paste_postprocess" => new \yii\web\JsExpression("function(plugin, args) {\n                args.node.innerHTML = args.node.innerHTML.replace(/(<p><\\/p>)/ig, '').replace(/(<p>&nbsp;<\\/p>)/ig, '').replace(/<p><br\\/?>\\s*<\\/p>/ig, '');\n                args.node.innerHTML = args.node.innerHTML.replace(/<a \\s*<\\/a>/ig, '');\n            }"), "templates" => [], "invalid_elements" => "script,iframe", "height" => 300, "language" => "ru", "language_url" => "/js/tinymce/langs/ru.js", "relative_urls" => false, "toolbar" => "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | forecolor backcolor | print preview media jbimages", "image_advtab" => "true"], isset($options['params']) ? $options['params'] : []);
     \yii::$app->view->registerJS('
         tinymce.init(' . \yii\helpers\Json::encode($params) . ');
     ');
     return $this;
 }
Exemplo n.º 7
0
 /**
  * @return string
  */
 public function run()
 {
     $this->registerAsset();
     $this->registerCsrf();
     $this->registerPlugins();
     $this->registerLanguage();
     $this->registerClientScript();
     if ($this->hasModel()) {
         return Html::activeTextArea($this->model, $this->attribute, $this->options);
     } else {
         return Html::textArea($this->name, $this->value, $this->options);
     }
 }
Exemplo n.º 8
0
 public function run()
 {
     EpiceditorAssets::register($this->view);
     $this->registerScripts();
     //text area should be hidden, and DIV should be shown
     $this->textareaHtmlOptions = ArrayHelper::merge($this->textareaHtmlOptions, ['style' => 'display:none']);
     $this->textareaHtmlOptions['id'] = $this->options['textarea'];
     if ($this->hasModel()) {
         echo Html::activeTextArea($this->model, $this->attribute, $this->textareaHtmlOptions);
     } else {
         echo Html::textArea($this->name, $this->value, $this->textareaHtmlOptions);
     }
     $this->divHtmlOptions = ArrayHelper::merge($this->divHtmlOptions, ['id' => $this->options['container']]);
     echo Html::tag('div', '', $this->divHtmlOptions);
 }
Exemplo n.º 9
0
 public function run()
 {
     if ($this->hasModel()) {
         echo Html::activeTextArea($this->model, $this->attribute, $this->options);
     } else {
         echo Html::textArea($this->name, $this->value, $this->options);
     }
     if (!isset($this->options['id'])) {
         $id = $this->hasModel() ? Html::getInputId($this->model, $this->attribute) : $this->getId();
     } else {
         $id = $this->options['id'];
     }
     $this->setOptions();
     $options = Json::encode($this->options);
     $this->registerEditorJs($id, $options);
 }
Exemplo n.º 10
0
$fieldExtra = '';
if (!empty($model->errors['phone'])) {
    $fieldExtra = 'has-feedback has-error';
}
echo Html::beginTag('div', ['class' => 'col-sm-6 form-group ' . $fieldExtra]);
echo Html::activeLabel($model, 'phone');
echo Html::activeTextInput($model, 'phone', ['class' => 'form-control']);
echo Html::error($model, 'phone', ['class' => 'help-inline text-danger']);
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::beginTag('div', ['class' => 'row']);
$fieldExtra = '';
if (!empty($model->errors['note'])) {
    $fieldExtra = 'has-feedback has-error';
}
echo Html::beginTag('div', ['class' => 'col-sm-6 form-group ' . $fieldExtra]);
echo Html::activeLabel($model, 'note');
echo Html::activeTextArea($model, 'note', ['class' => 'form-control']);
echo Html::error($model, 'note', ['class' => 'help-inline text-danger']);
echo Html::endTag('div');
echo Html::beginTag('div', ['class' => 'col-sm-6']);
echo Html::beginTag('div', ['class' => 'form-group ']);
echo Html::activeCheckbox($model, 'is_technical', []);
echo Html::endTag('div');
echo Html::beginTag('div', ['class' => 'form-group ']);
echo Html::activeCheckbox($model, 'is_billing', []);
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::endForm();
Exemplo n.º 11
0
 public function run()
 {
     $input = $this->hasModel() ? Html::activeTextArea($this->model, $this->attribute, $this->options) : Html::textArea($this->name, $this->value, $this->options);
     echo $input;
     $this->registerClientScript();
 }
Exemplo n.º 12
0
 /**
  * Render the text area input
  */
 protected function renderInput()
 {
     if ($this->hasModel()) {
         $input = Html::activeTextArea($this->model, $this->attribute, $this->options);
     } else {
         $input = Html::textArea($this->name, $this->value, $this->options);
     }
     Html::addCssClass($this->previewOptions, 'hidden');
     $preview = Html::tag('div', '', $this->previewOptions);
     return $input . "\n" . $preview;
 }
Exemplo n.º 13
0
								<div>
									<label for="">Название объявления</label>
								</div>
								<div>
									<?php 
echo Html::activeTextInput($model, 'name', ['v-model' => "name"]);
?>
								</div>
							</div><!-- end wrap -->
							<div class="input-wrap">
								<div>
									<label for="">Текст объявления</label>
								</div>
								<div>
									<?php 
echo Html::activeTextArea($model, 'text', ['v-model' => "text_area"]);
?>
								</div>
							</div><!-- end wrap -->
							<div class="input-wrap">
								<div>
									<label for="">Цена</label>
								</div>
								<div>
									<?php 
foreach ($model->typesPrice as $tprice) {
    ?>
										<div class="priceBlock general"> 
											<?php 
    echo Html::activeTextInput($model, 'price[' . $tprice->id . ']', ['class' => ["priceText"], 'v-model' => "price" . $tprice->id]);
    ?>
Exemplo n.º 14
0
 public function run()
 {
     return Html::activeTextArea($this->model, $this->attribute, $this->options);
 }