Exemplo n.º 1
0
use Micro\Web\Html\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();
Exemplo n.º 2
0
 /**
  * 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);
 }