Phpxforms documentation

RuleRequired extends Rule
in package

Abstract rule class

Table of Contents

Constants

FORMAT  = 'FORMAT'
MAX  = 'MAX'
MIN  = 'MIN'
RULE  = 'REQUIRED'

Properties

$invert  : bool
$message  : string
$mode  : string
$value  : mixed

Methods

__construct()  : mixed
getInpPara()  : string
getJSmessage()  : string
getMessage()  : string
getRuleVal()  : mixed|null
Returns rule value
getScript()  : array<string, mixed>
isValid()  : bool
Skip validating empty value
rebindInput()  : void
Replace Input from actual subform
setInvert()  : self
Set rule move
setMessage()  : self
Set error text message
translate()  : void
Translate plugin strings
getJsInput()  : array<string, mixed>|string
Get value or input link for javascript
validate()  : bool

Constants

FORMAT

public string FORMAT = 'FORMAT'

MAX

public string MAX = 'MAX'

MIN

public string MIN = 'MIN'

Properties

$invert

protected bool $invert = false

$message

protected string $message

$mode

protected string $mode

$value

protected mixed $value

Methods

__construct()

public __construct(string $mode, string $msg[, mixed|null $val = null ]) : mixed
Parameters
$mode : string
$msg : string

(can be different in child class)

$val : mixed|null = null

getInpPara()

public getInpPara(Input $input) : string
Parameters
$input : Input
Return values
string

getJSmessage()

public getJSmessage(Input $input) : string
Parameters
$input : Input
Tags
deprecated

since version 0.87

Return values
string

getMessage()

public getMessage(Input $input) : string
Parameters
$input : Input
Return values
string

getRuleVal()

Returns rule value

public getRuleVal() : mixed|null
Return values
mixed|null

getScript()

public getScript(Input $input) : array<string, mixed>
Parameters
$input : Input
Return values
array<string, mixed>

isValid()

Skip validating empty value

public isValid(Input $input) : bool
Parameters
$input : Input
Return values
bool

rebindInput()

Replace Input from actual subform

public rebindInput(int $type, Form $form) : void
Parameters
$type : int
$form : Form

setInvert()

Set rule move

public setInvert(bool $invert) : self
Parameters
$invert : bool
Return values
self

setMessage()

Set error text message

public setMessage(string $message) : self
Parameters
$message : string
Return values
self

getJsInput()

Get value or input link for javascript

protected getJsInput() : array<string, mixed>|string
Return values
array<string, mixed>|string

        
On this page

Search results