Example #1
0
 /**
  * Render a given field.
  *
  * @param  Field $field
  *
  * @return string
  */
 public function renderField(Field $field)
 {
     $output = '';
     if ($this->fieldNames) {
         $field->addName($this->fieldNames, true);
     }
     if ($_value = array_get($this->fillData, $field->dotName())) {
         $field->value($_value);
     }
     $output .= $this->fire('beforeField', $this, $field);
     if ($field->type == Field::RAW_FIELD_TYPE) {
         $fieldHtml = $field->value;
     } elseif ($this->manager->isMacro($field->type)) {
         $fieldHtml = $this->manager->callMacro($field->type, $field, $this->getRenderer());
     } else {
         $fieldHtml = $this->getRenderer()->field($field);
     }
     $output .= $fieldHtml;
     $output .= $this->fire('afterField', $this, $field);
     return $output;
 }