Phpxforms documentation

InputMediaDb extends InputNumber
in package
implements InNavigation, MultipleInput

Input for mediaDb

Table of Contents

Interfaces

InNavigation
Inject AdminNavigation into the input
MultipleInput
Interface for multiform input support

Properties

$addon  : array<int, string>|null
$allowHtml  : bool
$autoComplete  : string|null
$baseDir  : string
$bindTypes  : array<string, int>
$class  : string
$deletable  : bool
$empty  : bool
$error  : array<string|int, string>
$filter  : array<string, string>|string|bool
$float  : array<string, string>
$id  : string|int
$jsType  : string
$leadZeroes  : bool
$mark  : string
$maxSize  : int
$method  : int
$mode  : string
$precision  : array<string|int, int>
$quotes  : bool
$save  : string|bool|null
$showForm  : bool
$showTable  : bool
$size  : int
$sizeClass  : string
$spinner  : bool
$table  : bool
$tabSize  : int
$value  : mixed|null
$valueInit  : mixed|null
$dataBind  : array<string|int, array<string|int, Input>|Input>
$dbFilter  : string
$editModes  : array<string, int>
$mediaDb  : MediaDbGen
$name  : array<string, string>
$names  : array<string, int>
$nav  : AdminNavigation|null
$previewSize  : int
$rules  : array<string|int, Rule>
$saveModes  : array<string|int, int>
$type  : string
$types  : array<string, array<string|int, int>>

Methods

__construct()  : mixed
Basic input settings
__toString()  : string
addBind()  : self
Bind other inputs which interact with current one
convert()  : string
delete()  : string|bool
Action associated with deleting a master record
duplicate()  : void
Duplicate content from another input via POST/GET
getAssetScripts()  : array<string, mixed>|null
Get javascript files
getBind()  : array<string|int, Input>|Input|null
Get specified input bind-type
getBinds()  : array<string|int, array<string|int, Input>|Input>
Get bounded inputs
getClass()  : string
Get input classes
getForm()  : string
Get full form visualization
getGlobalInput()  : string
Get input for multi-upload inside form
getGlobalScript()  : string
Get javascript for multi-upload
getHide()  : string
Get input for type hidden
getInput()  : string
getJMark()  : string
Get javascript input var name
getLabel()  : string
Get html for <label />
getName()  : string
Get input name based on place
getPreview()  : string
getRule()  : Rule|null
Get selected input rule
getRules()  : array<string|int, Rule>
Return input rules
getScript()  : string|null
getScriptTable()  : string|null
getSize()  : string
Gets adequate css class for input size
getTable()  : array{VALUE: string, CLASS?: string, REWRITE?: bool}
Get input's value for presentation in list/table
getText()  : string
Get input's value for visualization
getValue()  : string|float|int|null
Get input raw value
globalDuplicate()  : void
Split selected values from multi-upload (without javascript)
injectNavigation()  : void
isDeletable()  : bool
isEmpty()  : bool
Is input empty
isQuotes()  : bool
Are magic quotes active
isValid()  : bool
Is input valid
load()  : void
Load POST/GET value
resetBinds()  : void
Remove bounded inputs
resetRules()  : void
Remove input rules
set()  : self
Set input value
setAddon()  : self
setId()  : self
Set form ID
setMax()  : self
setMaxLength()  : self
setMin()  : self
setMinLength()  : self
setMode()  : self
Set input work mode
setName()  : self
Set input descriptions
setPattern()  : self
setPrecision()  : self
setRequired()  : self
Set required message
setRule()  : self
Set input rule of selected type
setSave()  : self
Set input save mode
setValue()  : self
Set input value
translate()  : void
Translate input and rules descriptions
update()  : array<string, mixed>|string|null
Get data for storage update from form
updateTable()  : array<string|int, string>|bool
Get sql request for action from table
appendAddon()  : string
Add addons to input
check()  : bool
Check length settings
getBtnTitle()  : string
getFrameLink()  : string|null
Returns url to administration module
getInpName()  : string
Get input element name
getInputPreview()  : string
getMaxLength()  : int|null
getMethod()  : array<string|int, string|mixed>
getPost()  : mixed
Get POST/GET data and filter them
getPostData()  : mixed|null
Get POST/GET raw data
getType()  : string
getValueForm()  : string
Get value for input
inputBasic()  : string
Get general part of <input /> tag
isTransmitted()  : bool
Is (must be) input included in POST/GET
jErrors()  : string
Get error messages for javascript
modify()  : mixed
Change value based on input class/type
modValue()  : string|null

Properties

$addon

public array<int, string>|null $addon = null

Input prefix or suffix

$allowHtml

public static bool $allowHtml = false

$autoComplete

public string|null $autoComplete = null

Autocomplete attribute

$baseDir

public static string $baseDir = './'

Base directory for scripts

$bindTypes

public array<string, int> $bindTypes = []

Inputs bound to current one

$class

public string $class = 'form-control'

Default input CSS class

$empty

public bool $empty = true

Can be empty, default true

$error

public array<string|int, string> $error = []

Error messages

$filter

public array<string, string>|string|bool $filter = false

Filter type and allow in table settings (false / true / text / number / check / option - need getOption() )

$float

public static array<string, string> $float = ['SHOW' => ',', 'EDIT' => '.']

$id

public string|int $id

ID of form where input is

$mark

public string $mark

Input element name and db column

$method

public static int $method = INPUT_POST

Input content method

$mode

public string $mode = 'write'

Edit input type ( write / read / disable / hide / dummy - virtual input )

$precision

public array<string|int, int> $precision = []

$quotes

public static bool $quotes = null
Tags
deprecated

since version 0.86, will be removed at PHP 7.4+ min. requirements

$save

public string|bool|null $save = 'var'

Input storing value mode ( var / const - keep saved value / default - refreshing default value )

$showForm

public bool $showForm = true

Show preview image in form

$showTable

public bool $showTable = true

Show preview image in table

$size

public int $size

Size of input

$sizeClass

public static string $sizeClass = 'col-md-'

CSS class prefix

$table

public bool $table = true

Show in table, default true

$value

public mixed|null $value = null

Input value

$valueInit

public mixed|null $valueInit

Initial value (for save default)

$dataBind

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

Using another input as reference (type=>mark)

$editModes

protected static array<string, int> $editModes = ['write' => 1, 'read' => 1, 'disable' => 1, 'hide' => 1, 'dummy' => 1]

Show modes

$name

protected array<string, string> $name

LABEL name, TABLE name, SCRIPT name, TITLE input description text

$names

protected static array<string, int> $names = ['LABEL' => 1, 'TITLE' => 1, 'TABLE' => 1, 'PLACEHOLDER' => 1, 'SCRIPT' => 1]

$rules

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

Appended rules for input

$saveModes

protected static array<string|int, int> $saveModes = [ 'var' => 1, 'const' => 1, 'default' => 1, 0 => 1, // FALSE '' => 1, ]

Value modes - allow FALSE and NULL

$type

protected static string $type = 'text'

$types

protected static array<string, array<string|int, int>> $types = ['int' => [10], 'float' => [10, 2]]

Methods

__construct()

Basic input settings

public __construct(MediaDbGen $media, string $mark, mixed $name[, mixed $sets = [] ][, mixed $value = [] ]) : mixed
Parameters
$media : MediaDbGen
$mark : string
$name : mixed
$sets : mixed = []
$value : mixed = []

__toString()

public __toString() : string
Return values
string

addBind()

Bind other inputs which interact with current one

public addBind(Input $input[, string|null $type = null ]) : self
Parameters
$input : Input
$type : string|null = null
Tags
throws
InvalidArgumentException
Return values
self

convert()

public static convert(string|float|int $value, string $dot) : string
Parameters
$value : string|float|int
$dot : string
Return values
string

delete()

Action associated with deleting a master record

public delete() : string|bool
Return values
string|bool

duplicate()

Duplicate content from another input via POST/GET

public duplicate(int $fromId[, string|null $fromMark = null ]) : void
Parameters
$fromId : int
$fromMark : string|null = null

getAssetScripts()

Get javascript files

public getAssetScripts(bool $edit) : array<string, mixed>|null
Parameters
$edit : bool
Return values
array<string, mixed>|null

getBind()

Get specified input bind-type

public getBind(string $type) : array<string|int, Input>|Input|null
Parameters
$type : string
Return values
array<string|int, Input>|Input|null

getBinds()

Get bounded inputs

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

getClass()

Get input classes

public getClass() : string
Return values
string

getForm()

Get full form visualization

public getForm([string|bool $label = true ][, array{0: string, 1?: string|null, 2?: bool}|null $elem = ['p'] ][, string $post = '' ]) : string
Parameters
$label : string|bool = true
$elem : array{0: string, 1?: string|null, 2?: bool}|null = ['p']
$post : string = ''
Return values
string

getGlobalInput()

Get input for multi-upload inside form

public getGlobalInput(mixed $parentId, int $type) : string
Parameters
$parentId : mixed
$type : int
Return values
string

getGlobalScript()

Get javascript for multi-upload

public getGlobalScript(string $jMark) : string
Parameters
$jMark : string
Return values
string

getHide()

Get input for type hidden

public getHide() : string
Return values
string

getInput()

public getInput() : string
Return values
string

getJMark()

Get javascript input var name

public getJMark() : string
Return values
string

getLabel()

Get html for <label />

public getLabel([string|null $class = null ]) : string
Parameters
$class : string|null = null
Return values
string

getName()

Get input name based on place

public getName([string $type = 'TABLE' ]) : string
Parameters
$type : string = 'TABLE'
Return values
string

getPreview()

public getPreview([bool $lazy = true ]) : string
Parameters
$lazy : bool = true
Return values
string

getRule()

Get selected input rule

public getRule(string $type) : Rule|null
Parameters
$type : string
Return values
Rule|null

getRules()

Return input rules

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

getScript()

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

getScriptTable()

public getScriptTable() : string|null
Return values
string|null

getSize()

Gets adequate css class for input size

public getSize([int $crop = 0 ]) : string
Parameters
$crop : int = 0
Return values
string

getTable()

Get input's value for presentation in list/table

public getTable() : array{VALUE: string, CLASS?: string, REWRITE?: bool}
Return values
array{VALUE: string, CLASS?: string, REWRITE?: bool}

getText()

Get input's value for visualization

public getText() : string
Return values
string

getValue()

Get input raw value

public getValue() : string|float|int|null
Return values
string|float|int|null

globalDuplicate()

Split selected values from multi-upload (without javascript)

public globalDuplicate(int $parentId, int $type, int $ident) : void
Parameters
$parentId : int
$type : int
$ident : int

isDeletable()

public isDeletable() : bool
Return values
bool

isEmpty()

Is input empty

public isEmpty() : bool
Return values
bool

isQuotes()

Are magic quotes active

public isQuotes() : bool
Tags
deprecated

since version 0.86, will be removed at PHP 7.4+ min. requirements

Return values
bool

isValid()

Is input valid

public isValid() : bool
Return values
bool

load()

Load POST/GET value

public load() : void

resetBinds()

Remove bounded inputs

public resetBinds() : void

resetRules()

Remove input rules

public resetRules() : void

set()

Set input value

public set(array<string, mixed> $array[, bool $force = false ]) : self
Parameters
$array : array<string, mixed>
$force : bool = false
Return values
self

setAddon()

public setAddon(array<int, string>|string $addon) : self
Parameters
$addon : array<int, string>|string
Return values
self

setId()

Set form ID

public setId(string|int $id) : self
Parameters
$id : string|int
Return values
self

setMax()

public setMax(Input|float|int $val[, string|null $msg = null ]) : self
Parameters
$val : Input|float|int
$msg : string|null = null
Return values
self

setMaxLength()

public setMaxLength(int $val[, string|null $msg = null ]) : self
Parameters
$val : int
$msg : string|null = null
Return values
self

setMin()

public setMin(Input|float|int $val[, string|null $msg = null ]) : self
Parameters
$val : Input|float|int
$msg : string|null = null
Return values
self

setMinLength()

public setMinLength(int $val[, string|null $msg = null ]) : self
Parameters
$val : int
$msg : string|null = null
Return values
self

setMode()

Set input work mode

public setMode(string $mode) : self
Parameters
$mode : string
Tags
throws
InvalidArgumentException
Return values
self

setName()

Set input descriptions

public setName(array<string, string>|string $name[, string|null $type = null ]) : self
Parameters
$name : array<string, string>|string
$type : string|null = null
Tags
throws
InvalidArgumentException
Return values
self

setPattern()

public setPattern(string $pattern[, string|null $msg = null ]) : self
Parameters
$pattern : string
$msg : string|null = null
Return values
self

setPrecision()

public setPrecision(array<string|int, int>|string $val[, string|null $msg = null ]) : self
Parameters
$val : array<string|int, int>|string
$msg : string|null = null
Return values
self

setRequired()

Set required message

public setRequired([bool $require = true ][, string|null $msg = null ]) : self
Parameters
$require : bool = true
$msg : string|null = null
Return values
self

setRule()

Set input rule of selected type

public setRule(string $type, Rule $rule) : self
Parameters
$type : string
$rule : Rule
Return values
self

setSave()

Set input save mode

public setSave(string|bool|null $mode) : self
Parameters
$mode : string|bool|null
Tags
throws
InvalidArgumentException
Return values
self

setValue()

Set input value

public setValue(mixed $val) : self
Parameters
$val : mixed
Return values
self

update()

Get data for storage update from form

public update() : array<string, mixed>|string|null
Return values
array<string, mixed>|string|null

updateTable()

Get sql request for action from table

public updateTable(array<string, mixed>|string $action) : array<string|int, string>|bool
Parameters
$action : array<string, mixed>|string
Tags
throws
InvalidArgumentException
Return values
array<string|int, string>|bool

appendAddon()

Add addons to input

protected appendAddon(string $inp) : string
Parameters
$inp : string
Return values
string

check()

Check length settings

protected check(array<string, int> $array) : bool
Parameters
$array : array<string, int>
Return values
bool

getBtnTitle()

protected getBtnTitle(string $title) : string
Parameters
$title : string
Return values
string

Returns url to administration module

protected getFrameLink([string|null $filter = null ][, int|null $sizeId = null ][, bool $multiple = false ]) : string|null
Parameters
$filter : string|null = null
$sizeId : int|null = null
$multiple : bool = false
Return values
string|null

getInpName()

Get input element name

protected getInpName() : string
Return values
string

getInputPreview()

protected getInputPreview() : string
Return values
string

getMaxLength()

protected getMaxLength() : int|null
Return values
int|null

getMethod()

protected final static & getMethod() : array<string|int, string|mixed>
Return values
array<string|int, string|mixed>

getPost()

Get POST/GET data and filter them

protected getPost() : mixed
Tags
throws
InvalidArgumentException

getPostData()

Get POST/GET raw data

protected getPostData() : mixed|null
Return values
mixed|null

getType()

protected getType() : string
Return values
string

getValueForm()

Get value for input

protected getValueForm() : string
Return values
string

inputBasic()

Get general part of <input /> tag

protected inputBasic([string|null $append = null ]) : string
Parameters
$append : string|null = null
Return values
string

isTransmitted()

Is (must be) input included in POST/GET

protected isTransmitted() : bool
Return values
bool

jErrors()

Get error messages for javascript

protected final jErrors(string $jInput) : string
Parameters
$jInput : string
Return values
string

modify()

Change value based on input class/type

protected modify(mixed $val) : mixed
Parameters
$val : mixed

modValue()

protected modValue(string|null $value) : string|null
Parameters
$value : string|null
Return values
string|null

        
On this page

Search results