Magrathea PHP 2

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"

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
AdminForm

CRUDObject()

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

NormalizeFormArray()

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

        
On this page

Search results