Kajona\System\Admin\AdminFormgenerator

The admin-form generator is used to create, validate and manage forms for the backend.

Those forms are created as automatically as possible, so the setup of the field-types, validators
and more is done by reflection and code-inspection. Therefore, especially the annotations on the extending
\Kajona\System\System\Model-objects are analyzed.

There are three ways of adding entries to the current form, each representing a different level of
automation.
1. generateFieldsFromObject(), everything is rendered automatically
2. addDynamicField(), adds a single field based on its name
3. addField(), pass a field to add it explicitly

Synopsis

class AdminFormgenerator {
  • // constants
  • const STR_METHOD_POST = "POST";
  • const STR_METHOD_GET = "GET";
  • const STR_TYPE_ANNOTATION = "@fieldType";
  • const STR_VALIDATOR_ANNOTATION = "@fieldValidator";
  • const STR_MANDATORY_ANNOTATION = "@fieldMandatory";
  • const STR_LABEL_ANNOTATION = "@fieldLabel";
  • const STR_HIDDEN_ANNOTATION = "@fieldHidden";
  • const STR_READONLY_ANNOTATION = "@fieldReadonly";
  • const STR_OBJECTVALIDATOR_ANNOTATION = "@objectValidator";
  • const BIT_BUTTON_SAVE = 2;
  • const BIT_BUTTON_CLOSE = 4;
  • const BIT_BUTTON_CANCEL = 8;
  • const BIT_BUTTON_SUBMIT = 16;
  • const BIT_BUTTON_DELETE = 32;
  • const BIT_BUTTON_RESET = 64;
  • const BIT_BUTTON_CONTINUE = 128;
  • const BIT_BUTTON_BACK = 256;
  • const FORM_ENCTYPE_MULTIPART = "multipart/form-data";
  • const FORM_ENCTYPE_TEXTPLAIN = "text/plain";
}

Constants

Name Value
STR_METHOD_POST "POST"
STR_METHOD_GET "GET"
STR_TYPE_ANNOTATION "@fieldType"
STR_VALIDATOR_ANNOTATION "@fieldValidator"
STR_MANDATORY_ANNOTATION "@fieldMandatory"
STR_LABEL_ANNOTATION "@fieldLabel"
STR_HIDDEN_ANNOTATION "@fieldHidden"
STR_READONLY_ANNOTATION "@fieldReadonly"
STR_OBJECTVALIDATOR_ANNOTATION "@objectValidator"
BIT_BUTTON_SAVE 2
BIT_BUTTON_CLOSE 4
BIT_BUTTON_CANCEL 8
BIT_BUTTON_SUBMIT 16
BIT_BUTTON_DELETE 32
BIT_BUTTON_RESET 64
BIT_BUTTON_CONTINUE 128
BIT_BUTTON_BACK 256
FORM_ENCTYPE_MULTIPART "multipart/form-data"
FORM_ENCTYPE_TEXTPLAIN "text/plain"

Members

private

  • $arrFields — array
    The list of form-entries
  • $arrHiddenElements
  • $arrValidationErrors
  • $bitHiddenElementsVisible
  • $objLang
  • $objSourceobjectKajona\System\System\Model
    The source-object to be rendered by the form
  • $strFormEncoding
  • $strFormname — string
    The internal name of the form. Used to generate the field-identifiers and more.
  • $strHiddenGroupTitle
  • $strMethod
  • $strOnSubmit

Methods

private

protected

public