Form
class Form (View source)
Base class for forms, loads default configuration options, checks allowed values etc.
Properties
string | $name | Form name |
|
string[] | $fields | Form fields (paths), filled by readFormPaths(), indexed by field name |
|
array | $default | Stores default values for some fields (eg. pmadb tables) |
Methods
Reads default config values
Returns type of given option
Returns allowed values for select fields
Reset the group counter, function for testing purposes
Reads form paths to $fields
Reads fields' types to $this->fieldsTypes
Remove slashes from group names
Reads form settings and prepares class to work with given subset of config file
Details
__construct(string $formName, array $form, ConfigFile $configFile, int|null $index = null)
Reads default config values
string|null
getOptionType(string $optionName)
Returns type of given option
array
getOptionValueList(string $optionPath)
Returns allowed values for select fields
static void
resetGroupCounter()
Reset the group counter, function for testing purposes
protected void
readFormPaths(array $form)
Reads form paths to $fields
protected void
readTypes()
Reads fields' types to $this->fieldsTypes
protected array
cleanGroupPaths(array $form)
Remove slashes from group names
void
loadForm(string $formName, array $form)
Reads form settings and prepares class to work with given subset of config file