public function run()
 {
     MarkdowneditorAssets::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>';
 }
Example #2
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Archives;
use ijackua\lepture\Markdowneditor;
use ijackua\lepture\MarkdowneditorAssets;
/* @var $this yii\web\View */
/* @var $model common\models\Archives */
/* @var $form yii\widgets\ActiveForm */
MarkdowneditorAssets::register($this);
?>

<div class="archives-form" style='width:500px;'>

    <?php 
$form = ActiveForm::begin();
?>
    <?php 
echo $form->field($model, 'title')->textInput();
?>
    <?php 
echo $form->field($model, 'type')->dropDownList($arr);
?>
    
    <?php 
echo Markdowneditor::widget(['model' => $model, 'attribute' => 'content']);
?>

    <div class="form-group">
        <?php