FeedbackBase
in package
User Extended by Shawn Clake Abstract Class FeedbackBase User Extended is licensed under the MIT license.
Tags
Table of Contents
- $div : array<string|int, mixed>
- Div messages Includes success, error, and false
- $divOutput : mixed
- String to output in the destination div
- $flash : array<string|int, mixed>
- FLash messages Includes success, error, and false
- $flashOutput : mixed
- String to output in a flash message
- $status : int
- Feedback status Includes -1 => Failure, 0 => False, 1 => Success
- $validator : Validator
- Validator Instance
- customDivMessages() : array<string|int, mixed>
- Must be overridden by child classes in order to have individual feedback Must return an array
- customFlashMessages() : array<string|int, mixed>
- Must be overridden by child classes in order to have individual feedback Must return an array
- display() : array<string|int, mixed>
- Returns an array with the key being a destination div and the value being the HTML to put in it.
- flash() : mixed
- Flashes the feedback to the screen
- generate() : mixed
- Generates the feedback strings for flash and divs Also sets the feedback status
- with() :
- withFactory() : $this
- Factory method for setting up the custom flash and div messages and adding in the validator
Properties
$div
Div messages Includes success, error, and false
private
array<string|int, mixed>
$div
= []
$divOutput
String to output in the destination div
private
mixed
$divOutput
$flash
FLash messages Includes success, error, and false
private
array<string|int, mixed>
$flash
= []
$flashOutput
String to output in a flash message
private
mixed
$flashOutput
$status
Feedback status Includes -1 => Failure, 0 => False, 1 => Success
private
int
$status
$validator
Validator Instance
private
Validator
$validator
Methods
customDivMessages()
Must be overridden by child classes in order to have individual feedback Must return an array
public
abstract customDivMessages() : array<string|int, mixed>
Return values
array<string|int, mixed> —customFlashMessages()
Must be overridden by child classes in order to have individual feedback Must return an array
public
abstract customFlashMessages() : array<string|int, mixed>
Return values
array<string|int, mixed> —display()
Returns an array with the key being a destination div and the value being the HTML to put in it.
public
display( $destinationDiv) : array<string|int, mixed>
Works out of the box for backend pages, might not be as simple for front end pages. Returning the contents of this from an AJAX handler should update the applicable divs.
Parameters
Return values
array<string|int, mixed> —flash()
Flashes the feedback to the screen
public
flash() : mixed
Return values
mixed —generate()
Generates the feedback strings for flash and divs Also sets the feedback status
public
generate(mixed $flashErrors) : mixed
Parameters
- $flashErrors : mixed
Return values
mixed —with()
public
static with(mixed $validator, mixed $flashErrors, mixed $flash, mixed $div) :
FeedbackBase
Parameters
- $validator : mixed
- $flashErrors : mixed
- $flash : mixed
- $div : mixed
Return values
—withFactory()
Factory method for setting up the custom flash and div messages and adding in the validator
public
withFactory( $validator[, mixed $flashErrors = false ][, array<string|int, mixed> $flash = [] ][, array<string|int, mixed> $div = [] ]) : $this
Parameters
- $validator :
- $flashErrors : mixed = false
- $flash : array<string|int, mixed> = []
- $div : array<string|int, mixed> = []