Phpxforms documentation

FormControl extends Control
in package
Uses AlertForm

Control for form editing

Tags
author

DaVee

version
0.87dev
license

Lesser General Public License 2.1 or later; see http://www.gnu.org/licenses/lgpl-2.1.html

Table of Contents

Properties

$actions  : array<int, array<string, mixed>>
$buttons  : array<string, array<string, string>>
$formElementId  : string
$jMark  : string
$jOption  : array<string, mixed>
$primary  : Form
$ajax  : bool|null
$cacheFile  : CacheUpload|null
$db  : SQL
$fileApi  : FileApi
$maxFileUpload  : int
$nav  : AdminNavigation
$sync  : Synchronize|null
$tabActive  : int
$tabForms  : array<int, array<string|int, Form>>
$tabNames  : array<string|int, string>

Methods

__construct()  : mixed
addAction()  : void
Form specific
addTab()  : void
Form specific
copy()  : bool
At SYNC reads data from VIEW
delete()  : bool
disable()  : void
getCss()  : array<string, mixed>
Gets css for controller, form and plugins
getErrors()  : array<string|int, string>
getFormById()  : Form|null
getForms()  : array<string|int, Form>
Returns list of all forms
getScript()  : array<string, mixed>
Adds javascript for forms and inputs
isValid()  : bool
load()  : void
Load data to form
loadPost()  : void
loadPostMultiple()  : void
multiply()  : void
Printing multiple edit form
render()  : void
renderAlert()  : void
Prints alert form
renderForm()  : void
save()  : bool
At SYNC reads data from VIEW
setButtons()  : void
setOrder()  : void
Table specific
setPrimary()  : void
Set primary form
setTableColumns()  : void
Table specific
setUp()  : void
sync()  : bool
allowAjax()  : bool
checkActionUpdate()  : array<int, array<string, mixed>>|null
createFormList()  : array<string|int, Form>
Creates list of all forms
getAssetScript()  : array<string, mixed>
Get list of all javascript files required by used forms
getButtons()  : string
Prints dialog action buttons
renderTabs()  : void
scriptActions()  : string
scriptActionsCondition()  : array<string|int, mixed>
updateInjections()  : void
Carry out dependency injections in form and inputs
uploadCache()  : CacheUpload|void
Upload to cache TODO: move to separate plug-in

Properties

$actions

public array<int, array<string, mixed>> $actions = []

$buttons

public array<string, array<string, string>> $buttons = ['form_save' => ['TYPE' => 'submit', 'VALUE' => '<i class="fa fa-save"></i> Uložit', 'CLASS' => 'btn-success'], 'form_stay' => ['TYPE' => 'submit', 'VALUE' => 'Uložit a dále editovat', 'CLASS' => 'btn-success'], 'form_reset' => ['TYPE' => 'reset', 'VALUE' => 'Reset', 'CLASS' => 'btn-danger'], 'form_back' => ['TYPE' => 'link', 'VALUE' => 'Zpět', 'CLASS' => 'btn-secondary', 'ALIGN' => 'right']]

$formElementId

public string $formElementId = 'mainForm'

$jOption

public array<string, mixed> $jOption = ['preUpload' => true]

$tabNames

protected array<string|int, string> $tabNames = []

Methods

addAction()

Form specific

public addAction(mixed $inputs, mixed $targets[, mixed|null $else = null ][, bool $begin = true ]) : void
Parameters
$inputs : mixed

IN (input), ACTION (SET,CHANGE), / VALUE

$targets : mixed

OUT (input,form), ACTION (ENABLE,DISABLE,SHOW,HIDE,REMOVE,SET), / VALUE (also disable for select/checkboxes)

$else : mixed|null = null

OUT, possible true for INVERT ACTION (ENABLE,DISABLE,SHOW,HIDE) or OUT true with different action

$begin : bool = true
Tags
throws
InvalidArgumentException

addTab()

Form specific

public addTab(string $name, array<string|int, Form>|Form $forms) : void
Parameters
$name : string
$forms : array<string|int, Form>|Form
Tags
throws
InvalidArgumentException

copy()

At SYNC reads data from VIEW

public copy([bool $forced = false ]) : bool
Parameters
$forced : bool = false
Return values
bool

getCss()

Gets css for controller, form and plugins

public getCss() : array<string, mixed>
Return values
array<string, mixed>

getErrors()

public getErrors() : array<string|int, string>
Return values
array<string|int, string>

getFormById()

public getFormById(int $id) : Form|null
Parameters
$id : int
Return values
Form|null

getForms()

Returns list of all forms

public getForms() : array<string|int, Form>
Return values
array<string|int, Form>

getScript()

Adds javascript for forms and inputs

public getScript([string|null $jParent = null ]) : array<string, mixed>
Parameters
$jParent : string|null = null
Return values
array<string, mixed>

isValid()

public isValid() : bool
Return values
bool

load()

Load data to form

public load(array<string|int, int>|string|int $id) : void
Parameters
$id : array<string|int, int>|string|int

ID primary row

loadPostMultiple()

public loadPostMultiple() : void

multiply()

Printing multiple edit form

public multiply(string $multiSave) : void
Parameters
$multiSave : string

render()

public render(string $action[, array<string|int, string|float|int>|string|float|int $ids = '' ]) : void
Parameters
$action : string
$ids : array<string|int, string|float|int>|string|float|int = ''

renderAlert()

Prints alert form

public renderAlert(string $action, array<string|int, string|int>|string|int|null $ids, string $text, array<string, array<string, mixed>> $buttons) : void
Parameters
$action : string
$ids : array<string|int, string|int>|string|int|null
$text : string
$buttons : array<string, array<string, mixed>>

save()

At SYNC reads data from VIEW

public save([bool $forced = false ]) : bool
Parameters
$forced : bool = false
Return values
bool

setButtons()

public setButtons(array<string, array<string, string>>|string $buttons) : void
Parameters
$buttons : array<string, array<string, string>>|string
Tags
throws
InvalidArgumentException

setOrder()

Table specific

public setOrder(array<string|int, Input>|Input $inputs, array<string|int, string>|string $directions) : void
Parameters
$inputs : array<string|int, Input>|Input
$directions : array<string|int, string>|string

setPrimary()

Set primary form

public setPrimary(Form $primary) : void
Parameters
$primary : Form

setTableColumns()

Table specific

public setTableColumns(array<string|int, Input$columns) : void
Parameters
$columns : array<string|int, Input>

setUp()

public setUp([bool|null $foreign = null ][, bool $edit = true ]) : void
Parameters
$foreign : bool|null = null
$edit : bool = true

sync()

public sync(mixed $idRec) : bool
Parameters
$idRec : mixed
Return values
bool

allowAjax()

protected allowAjax() : bool
Return values
bool

checkActionUpdate()

protected checkActionUpdate(array<string, mixed>|null $action) : array<int, array<string, mixed>>|null
Parameters
$action : array<string, mixed>|null
Tags
throws
InvalidArgumentException
Return values
array<int, array<string, mixed>>|null

createFormList()

Creates list of all forms

protected createFormList(Form $form) : array<string|int, Form>
Parameters
$form : Form
Return values
array<string|int, Form>

getAssetScript()

Get list of all javascript files required by used forms

protected getAssetScript(bool $edit) : array<string, mixed>
Parameters
$edit : bool
Return values
array<string, mixed>

getButtons()

Prints dialog action buttons

protected getButtons(array<string, array<string, mixed>> $buttons) : string
Parameters
$buttons : array<string, array<string, mixed>>
Return values
string

scriptActions()

protected scriptActions() : string
Return values
string

scriptActionsCondition()

protected scriptActionsCondition(array<string|int, mixed> $conditions) : array<string|int, mixed>
Parameters
$conditions : array<string|int, mixed>
Return values
array<string|int, mixed>

updateInjections()

Carry out dependency injections in form and inputs

protected updateInjections(Form $form) : void
Parameters
$form : Form

        
On this page

Search results