/** * Prints out Field wrapped in ControlGroup * * @return string A form field */ public function __toString() { if (static::$form and !static::$form->isOpened()) { return static::form()->__toString(); } // Dry syntax (hidden fields, plain fields) if (static::$field->isUnwrappable()) { $html = static::$field->__toString(); } elseif (Framework::isnt(null) and static::$form) { $html = $this->control()->wrapField(static::$field); } else { $html = Framework::label(static::$field); $html .= static::$field; } return $html; }