当前位置: 首页>>代码示例>>PHP>>正文


PHP Html::activeTextarea方法代码示例

本文整理汇总了PHP中yii\helpers\Html::activeTextarea方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::activeTextarea方法的具体用法?PHP Html::activeTextarea怎么用?PHP Html::activeTextarea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\helpers\Html的用法示例。


在下文中一共展示了Html::activeTextarea方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     Assets::register($this->getView());
     echo Html::beginTag('div', $this->containerOptions);
     if ($this->hasModel()) {
         echo Html::activeTextarea($this->model, $this->attribute, $this->options);
     } else {
         echo Html::textarea($this->name, $this->value, $this->options);
     }
     echo Html::endTag('div');
     $js = ['bajadev.ckEditor.registerOnChange(' . Json::encode($this->options['id']) . ');'];
     if (isset($this->editorOptions['filebrowserUploadUrl'])) {
         $js[] = "bajadev.ckEditor.registerCsrf();";
     }
     if (!isset($this->editorOptions['on']['instanceReady'])) {
         $this->editorOptions['on']['instanceReady'] = new JsExpression("function( ev ){" . implode(' ', $js) . "}");
     }
     if ($this->_inline) {
         $JavaScript = "CKEDITOR.inline(";
         $JavaScript .= Json::encode($this->options['id']);
         $JavaScript .= empty($this->editorOptions) ? '' : ', ' . Json::encode($this->editorOptions);
         $JavaScript .= ");";
         $this->getView()->registerJs($JavaScript, View::POS_END);
         $this->getView()->registerCss('#' . $this->containerOptions['id'] . ', #' . $this->containerOptions['id'] . ' .cke_textarea_inline{height: ' . $this->editorOptions['height'] . 'px;}');
     } else {
         $JavaScript = "CKEDITOR.replace(";
         $JavaScript .= Json::encode($this->options['id']);
         $JavaScript .= empty($this->editorOptions) ? '' : ', ' . Json::encode($this->editorOptions);
         $JavaScript .= ");";
         $this->getView()->registerJs($JavaScript, View::POS_END);
     }
 }
开发者ID:bajadev,项目名称:yii2-ckeditor,代码行数:32,代码来源:CKEditor.php

示例2: editable

    protected function editable()
    {
        $id = $this->id;
        $autocompletion = $this->autocompletion ? 'true' : 'false';
        if ($this->autocompletion) {
            $this->aceOptions['enableBasicAutocompletion'] = true;
            $this->aceOptions['enableSnippets'] = true;
            $this->aceOptions['enableLiveAutocompletion'] = false;
        }
        $aceOptions = Json::encode($this->aceOptions);
        $js = <<<JS
(function(){
    var aceEditorAutocompletion = {$autocompletion};

    if (aceEditorAutocompletion) {
        ace.require("ace/ext/language_tools");
    }

    {$this->varNameAceEditor} = ace.edit("{$id}");
    {$this->varNameAceEditor}.setTheme("ace/theme/{$this->theme}");
    {$this->varNameAceEditor}.getSession().setMode("ace/mode/{$this->mode}");
    {$this->varNameAceEditor}.setOptions({$aceOptions});
})();
JS;
        $view = $this->getView();
        $view->registerJs("\nvar {$this->varNameAceEditor} = {};\n", $view::POS_HEAD);
        $view->registerJs($js);
        if ($this->hasModel()) {
            return Html::activeTextarea($this->model, $this->attribute, $this->options);
        }
        return Html::textarea($this->name, $this->value, $this->options);
    }
开发者ID:wbraganca,项目名称:yii2-ace-widget,代码行数:32,代码来源:AceEditorWidget.php

示例3: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     switch ($this->thema) {
         case 'mini':
             $this->getMiniSetting();
             break;
         case 'full':
             $this->getFullSetting();
             break;
         default:
             $this->getDefaultSetting();
             break;
     }
     //Додаємо поле для редактору та визначаємо ідентифікатор
     if (!isset($this->settings['selector'])) {
         $this->settings['selector'] = '#' . $this->options['id'];
         $this->_textarea = $this->hasModel() ? Html::activeTextarea($this->model, $this->attribute, $this->options) : Html::textarea($this->name, $this->value, $this->options);
     }
     /* Якщо [[options['selector']]] false видаляємо з налаштувань. */
     if (isset($this->settings['selector']) && $this->settings['selector'] === false) {
         unset($this->settings['selector']);
     }
     if (empty($this->language)) {
         $this->language = Yii::$app->language;
     }
     $this->settings = ArrayHelper::merge($this->_defaultSettings, $this->settings);
 }
开发者ID:filamentv,项目名称:yii2-app,代码行数:31,代码来源:Tinymce.php

示例4: editable

    protected function editable()
    {
        $id = $this->id;
        $autocompletion = $this->autocompletion ? 'true' : 'false';
        if ($this->autocompletion) {
            $this->aceOptions['enableBasicAutocompletion'] = true;
            $this->aceOptions['enableSnippets'] = true;
            $this->aceOptions['enableLiveAutocompletion'] = false;
        }
        $aceOptions = Json::encode($this->aceOptions);
        $this->view->registerJs(<<<JS
(function(){
    if({$autocompletion}) {
        ace.require("ace/ext/language_tools");
    }

    var _editor = ace.edit("{$id}");
    _editor.setTheme("ace/theme/{$this->theme}");
    _editor.getSession().setMode("ace/mode/{$this->mode}");
    _editor.setOptions({$aceOptions});
})();
JS
);
        if ($this->hasModel()) {
            $html = Html::activeTextarea($this->model, $this->attribute, $this->options);
        } else {
            $html = Html::textarea($this->name, $this->value, $this->options);
        }
        return $html;
    }
开发者ID:borales,项目名称:yii2-ace-widget,代码行数:30,代码来源:Widget.php

示例5: run

 public function run()
 {
     $this->autoSavePath .= $this->parentType . '/' . $this->parentId;
     $this->options['id'] .= $this->parentId;
     $this->widgetOptions['id'] .= $this->parentId;
     switch ($this->_enableRevisions) {
         case true:
             $this->revisionsModel->setScenario('validateNew');
             $revisionOptions = ['role' => $this->options['role'], 'id' => $this->options['id'] . $this->parentId, 'data-dave-path' => $this->autoSavePath, 'data-use-redactor' => $this->enableRedactor];
             Asset::register($this->getView());
             break;
         default:
             $revisionOptions = [];
             break;
     }
     switch ($this->enableRedactor) {
         case true:
             $this->editorOptions['id'] = 'message' . uniqid();
             $this->editorOptions['model'] = $this->model;
             $this->editorOptions['attribute'] = $this->name;
             $this->editorOptions['options']['value'] = $this->value;
             $input = Editor::widget($this->editorOptions);
             break;
         default:
             $input = Html::activeTextarea($this->model, $this->name, $revisionOption);
             break;
     }
     $result = Html::tag('div', '', ['role' => 'revisionStatus']);
     echo Html::tag('div', $input . $result, $this->widgetOptions);
 }
开发者ID:nhatvuvan,项目名称:yii2-widgets,代码行数:30,代码来源:RevisionsInput.php

示例6: run

 /**
  * @inheritdoc
  */
 public function run()
 {
     $this->registerAssets();
     echo $this->hasModel() ? Html::activeTextarea($this->model, $this->attribute, $this->options) : Html::textarea($this->name, $this->value, $this->options);
     $clientOptions = empty($this->clientOptions) ? null : Json::encode($this->clientOptions);
     $this->getView()->registerJs('jQuery( "#' . $this->options['id'] . '" ).summernote(' . $clientOptions . ');');
 }
开发者ID:germanigortcev,项目名称:yii2-summernote-widget,代码行数:10,代码来源:Summernote.php

示例7: run

 /**
  * @inheritdoc
  */
 public function run()
 {
     echo $this->hasModel() ? Html::activeTextarea($this->model, $this->attribute, $this->options) : Html::textarea($this->name, $this->value, $this->options);
     $this->clientOptions['onImageUpload'] = new JsExpression("function(files){summerNoteImgUpload(files[0], '" . $this->options['id'] . "','" . $this->imgServer . "')}");
     $clientOptions = empty($this->clientOptions) ? null : Json::encode($this->clientOptions);
     $this->getView()->registerJs('jQuery( "#' . $this->options['id'] . '" ).summernote(' . $clientOptions . ');');
 }
开发者ID:sea129,项目名称:kbay,代码行数:10,代码来源:SummernoteWidget.php

示例8: run

 public function run()
 {
     $this->tagOptions['data-input'] = '#' . $this->options['id'];
     $this->options['style'] = 'display: none;';
     $this->registerClientScripts();
     echo Html::tag('div', Html::getAttributeValue($this->model, $this->attribute), $this->tagOptions);
     echo Html::activeTextarea($this->model, $this->attribute, $this->options);
 }
开发者ID:kotchuprik,项目名称:yii2-medium-widget,代码行数:8,代码来源:Widget.php

示例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);
     }
 }
开发者ID:himiklab,项目名称:yii2-ckeditor-widget,代码行数:8,代码来源:CKEditor.php

示例10: getInputField

 /**
  * @param string $attribute
  *
  * @return string
  */
 public function getInputField($attribute)
 {
     if ($this->inputType == 'textArea') {
         return Html::activeTextarea($this->model, $attribute, $this->inputOptions);
     } else {
         return Html::activeTextInput($this->model, $attribute, $this->inputOptions);
     }
 }
开发者ID:advance100,项目名称:multilanguage,代码行数:13,代码来源:MultiLanguageActiveField.php

示例11: renderInput

 /**
  * Renders the widget.
  */
 public function renderInput()
 {
     Html::addCssClass($this->_displayOptions, 'element-' . $this->options['id']);
     Html::addCssClass($this->_displayOptions, 'form-control');
     $this->_displayOptions['rows'] = 1;
     $input = Html::activeTextarea($this->model, $this->attribute, $this->_displayOptions);
     echo $input;
 }
开发者ID:bepehr,项目名称:yii2-textareaautosize,代码行数:11,代码来源:yii2textareaautosize.php

示例12: run

    public function run()
    {
        BootstrapMarkdownAsset::register($this->view);
        $this->view->registerJs('
            var markdown=$("#markdown-textarea").markdown({autofocus:true});

        ');
        return Html::activeTextarea($this->model, $this->attribute, $this->options);
    }
开发者ID:Penton,项目名称:MoBlog,代码行数:9,代码来源:BootstrapMarkdown.php

示例13: run

 public function run()
 {
     $this->registerClientScript();
     if ($this->hasModel()) {
         return Html::activeTextarea($this->model, $this->attribute, ['id' => $this->id]);
     } else {
         return Html::textarea($this->id, $this->value, ['id' => $this->id]);
     }
 }
开发者ID:h1cms,项目名称:h1cms-ueditor,代码行数:9,代码来源:Ueditor.php

示例14: run

 /**
  * @inheritdoc
  */
 public function run()
 {
     if ($this->hasModel()) {
         $content = Html::activeTextarea($this->model, $this->attribute, $this->options);
     } else {
         $content = Html::textarea($this->name, $this->value, $this->options);
     }
     return $content;
 }
开发者ID:andreosoft,项目名称:yii2-codemirror-widget,代码行数:12,代码来源:Codemirror.php

示例15: run

 public function run()
 {
     Autogrow::widget(['selector' => '#' . $this->options['id']]);
     if ($this->hasModel()) {
         return Html::activeTextarea($this->model, $this->attribute, $this->options);
     } else {
         return Html::textarea($this->name, $this->value, $this->options);
     }
 }
开发者ID:moonlandsoft,项目名称:autogrow,代码行数:9,代码来源:AutogrowInput.php


注:本文中的yii\helpers\Html::activeTextarea方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。