Ejemplo 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();
Ejemplo n.º 2
0
 /**
  * Render week field row
  *
  * @access public
  *
  * @param IFormModel $model model
  * @param string $property model property
  * @param array $options attribute array
  *
  * @return string
  */
 public function weekFieldRow(IFormModel $model, $property, array $options = [])
 {
     $element = $this->getField($model, $property);
     $options['id'] = $element['id'];
     return Html::openTag('div', $this->getBlock('block', $options)) . Html::label($model->getLabel($property), $element['id'], $this->getBlock('label', $options)) . $this->weekField($model, $property, $options) . Html::closeTag('div');
 }