/** * Add a FormField to the form's fields * * @param FormField $field * @return $this */ protected function addField(FormField $field, $modify = false) { if (!$modify && !$this->rebuilding) { $this->preventDuplicate($field->getRealName()); } if ($field->getType() == 'file') { $this->formOptions['files'] = true; } $this->fields[$field->getRealName()] = $field; return $this; }
/** * Check if the field is one of certain types. * * @param string|array $types * @return bool */ protected function isType($types) { return in_array($this->field->getType(), (array) $types); }