本文整理汇总了PHP中yii\helpers\Html::activeTextArea方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::activeTextArea方法的具体用法?PHP Html::activeTextArea怎么用?PHP Html::activeTextArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\helpers\Html
的用法示例。
在下文中一共展示了Html::activeTextArea方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderInput
/**
* 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;
}
示例2: count
<?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>
示例3: run
/**
* @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();
}
示例4: run
/**
* @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);
}
}
示例5: run
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>';
}
示例6: tinymce
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> <\\/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;
}
示例7: run
/**
* @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);
}
}
示例8: run
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);
}
示例9: run
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);
}
示例10:
$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();
示例11: run
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();
}
示例12: renderInput
/**
* 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;
}
示例13:
<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]);
?>
示例14: run
public function run()
{
return Html::activeTextArea($this->model, $this->attribute, $this->options);
}