/** * Render textarea tag * * @access public * * @param IFormModel $model model * @param string $property model property * @param array $options attributes array * * @return string */ public function textAreaField(IFormModel $model, $property, array $options = []) { $element = $this->getField($model, $property); $options['id'] = $element['id']; return Html::textArea($element['name'], $element['value'], $options); }
use Micro\web\Html; /** @var \App\modules\Blog\models\Blog $model */ echo Html::beginForm(''); ?> <div class="row"> <?php echo Html::label('Название'); ?> <?php echo Html::textField('Blog[name]', $model->name, ['required' => true]); ?> </div> <div class="row"> <?php echo Html::label('Описание'); ?> <?php echo Html::textArea('Blog[content]', $model->content, ['required' => true]); ?> </div> <div class="row actions"> <?php echo Html::submitButton($model->isNewRecord() ? 'Создать' : 'Обновить'); ?> </div> <?php echo Html::endForm();