/**
  * @param array $options
  * @param bool  $showLabel
  * @param bool  $showField
  * @param bool  $showError
  * @return string
  */
 public function render(array $options = array(), $showLabel = true, $showField = true, $showError = true)
 {
     if ($showField) {
         $this->rendered = true;
     }
     $options = $this->prepareOptions($options);
     if (!$this->needsLabel($options)) {
         $showLabel = false;
     }
     return $this->formHelper->getView()->make($this->template, array('name' => $this->name, 'type' => $this->type, 'options' => $options, 'showLabel' => $showLabel, 'showField' => $showField, 'showError' => $showError))->render();
 }
Пример #2
0
 /**
  * Render the form
  *
  * @param $options
  * @param $fields
  * @param boolean $showStart
  * @param boolean $showFields
  * @param boolean $showEnd
  * @return string
  */
 protected function render($options, $fields, $showStart, $showFields, $showEnd)
 {
     $formOptions = $this->formHelper->mergeOptions($this->formOptions, $options);
     return $this->formHelper->getView()->make($this->formHelper->getConfig('form'))->with(compact('showStart', 'showFields', 'showEnd'))->with('formOptions', $formOptions)->with('fields', $fields)->with('model', $this->getModel())->render();
 }