PHP Class Proengsoft\JsValidation\Javascript\JavascriptValidator

Inheritance: implements Illuminate\Contracts\Support\Arrayable
Mostrar archivo Open project: proengsoft/laravel-jsvalidation

Protected Properties

Property Type Description
$ignore string 'ignore' option for jQuery Validation Plugin.
$remote boolean Enable or disable remote validations.
$selector string Selector used in javascript generation.
$validator Proengsoft\JsValidation\Javascript\ValidatorHandler Registered validator instance.
$view View that renders Javascript.

Public Methods

Method Description
__construct ( Proengsoft\JsValidation\Javascript\ValidatorHandler $validator, array $options = [] )
__get ( $name ) : string Gets value from view data.
__toString ( ) : string Get the string resulting of render default view.
ignore ( string $ignore ) : JavascriptValidator Set the input selector to ignore for validation.
remote ( boolean | null $enabled = true ) : JavascriptValidator Enables or disables remote validations.
render ( Illuminate\Contracts\View\View | string | null $view = null, string | null $selector = null ) : string Render the specified view with validator data.
selector ( string $selector ) : JavascriptValidator Set the form selector to validate.
setSelector ( string $selector ) Set the form selector to validate.
sometimes ( string $attribute, string | array $rules ) : JavascriptValidator Validate Conditional Validations using Ajax in specified fields.
toArray ( ) : array Get the view data as an array.
view ( Illuminate\Contracts\View\View | string | null $view ) : JavascriptValidator Set the view to render Javascript Validations.

Protected Methods

Method Description
getViewData ( ) : array Gets view data.
setDefaults ( $options ) Set default parameters.

Method Details

__construct() public method

public __construct ( Proengsoft\JsValidation\Javascript\ValidatorHandler $validator, array $options = [] )
$validator Proengsoft\JsValidation\Javascript\ValidatorHandler
$options array

__get() public method

Gets value from view data.
public __get ( $name ) : string
$name
return string

__toString() public method

Get the string resulting of render default view.
public __toString ( ) : string
return string

getViewData() protected method

Gets view data.
protected getViewData ( ) : array
return array

ignore() public method

Set the input selector to ignore for validation.
public ignore ( string $ignore ) : JavascriptValidator
$ignore string
return JavascriptValidator

remote() public method

Enables or disables remote validations.
public remote ( boolean | null $enabled = true ) : JavascriptValidator
$enabled boolean | null
return JavascriptValidator

render() public method

Render the specified view with validator data.
public render ( Illuminate\Contracts\View\View | string | null $view = null, string | null $selector = null ) : string
$view Illuminate\Contracts\View\View | string | null
$selector string | null
return string

selector() public method

Set the form selector to validate.
public selector ( string $selector ) : JavascriptValidator
$selector string
return JavascriptValidator

setDefaults() protected method

Set default parameters.
protected setDefaults ( $options )
$options

setSelector() public method

Set the form selector to validate.
Deprecation:
public setSelector ( string $selector )
$selector string

sometimes() public method

Validate Conditional Validations using Ajax in specified fields.
public sometimes ( string $attribute, string | array $rules ) : JavascriptValidator
$attribute string
$rules string | array
return JavascriptValidator

toArray() public method

Get the view data as an array.
public toArray ( ) : array
return array

view() public method

Set the view to render Javascript Validations.
public view ( Illuminate\Contracts\View\View | string | null $view ) : JavascriptValidator
$view Illuminate\Contracts\View\View | string | null
return JavascriptValidator

Property Details

$ignore protected_oe property

'ignore' option for jQuery Validation Plugin.
protected string $ignore
return string

$remote protected_oe property

Enable or disable remote validations.
protected bool $remote
return boolean

$selector protected_oe property

Selector used in javascript generation.
protected string $selector
return string

$validator protected_oe property

Registered validator instance.
protected ValidatorHandler,Proengsoft\JsValidation\Javascript $validator
return Proengsoft\JsValidation\Javascript\ValidatorHandler

$view protected_oe property

View that renders Javascript.
protected $view