AdminForm
in package
Class for Admin Elements
Table of Contents
Properties
- $defaultSize : mixed
- $elements : mixed
- $formName : mixed
- $values : mixed
Methods
- Build() : AdminForm
- Prints a form for a object types: hidden, empty (for a empty div), text, disabled, number, email, date, checkbox, switch, submit, button, save-button, delete-button, array (builds a select 'id' => 'name') key: object's property. can be a function (in case of a button)
- CRUDObject() : array<string|int, mixed>
- CRUD an object, automatically getting the action and the post -- to be used in combination with `FormObject`
- Print() : mixed
- Prints the form
- SetName() : AdminForm
- Sets the form name/id
- NormalizeFormArray() : array<string|int, mixed>
- printAlert() : mixed
Properties
$defaultSize
public
mixed
$defaultSize
= "col-sm-12 col-md-6"
$elements
public
mixed
$elements
$formName
public
mixed
$formName
$values
public
mixed
$values
Methods
Build()
Prints a form for a object types: hidden, empty (for a empty div), text, disabled, number, email, date, checkbox, switch, submit, button, save-button, delete-button, array (builds a select 'id' => 'name') key: object's property. can be a function (in case of a button)
public
Build(array<string|int, mixed> $elements[, MagratheaModel|array<string|int, mixed> $object = [] ]) : AdminForm
Parameters
- $elements : array<string|int, mixed>
-
arary with [ name, size, key, type, class, placeholder, attributes ]
- $object : MagratheaModel|array<string|int, mixed> = []
-
Magrathea Model Object
Return values
AdminFormCRUDObject()
CRUD an object, automatically getting the action and the post -- to be used in combination with `FormObject`
public
CRUDObject(MagratheaModel $object[, mixed $printsInfo = false ]) : array<string|int, mixed>
Parameters
- $object : MagratheaModel
-
Magrathea Model Object
- $printsInfo : mixed = false
Return values
array<string|int, mixed> —operation success
Print()
Prints the form
public
Print() : mixed
SetName()
Sets the form name/id
public
SetName(string $name) : AdminForm
Parameters
- $name : string
Return values
AdminFormNormalizeFormArray()
private
NormalizeFormArray(mixed $arr) : array<string|int, mixed>
Parameters
- $arr : mixed
Return values
array<string|int, mixed>printAlert()
private
printAlert(mixed $msg, mixed $type) : mixed
Parameters
- $msg : mixed
- $type : mixed