예제 #1
0
 /**
  * Render form heading
  *
  * @access public
  * @return void
  */
 public function beginRender()
 {
     $this->form = $this->widget->init();
     if (!empty($this->config['legend'])) {
         echo Html::openTag('fieldset');
         echo Html::legend($this->config['legend']);
     }
     if (!empty($this->config['description'])) {
         echo Html::openTag('div', ['class' => 'description']), $this->config['description'], Html::closeTag('div');
     }
     if ($this->model) {
         $errors = $this->getModelErrors();
         if ($errors) {
             echo Html::openTag('div', ['class' => 'errors']);
             foreach ($errors as $error) {
                 echo Html::openTag('div', ['class' => 'error']), $error, Html::closeTag('div');
             }
             echo Html::closeTag('div');
         }
     }
 }