PHP Trait Voodoo\Core\View\TView

Show file Open project: voodoophp/voodoo

Protected Properties

Property Type Description
$assigned
$messages

Public Methods

Method Description
assign ( mixed $key, mixed $val = "" ) : Api Assign variable
getAssigned ( ) : Array Get all the assigned vars
getMessage ( string $type ) : Array | null To return the messages saved
getMessages ( ) : Array Return all the messages
hasError ( ) : boolean Check if error exist
setError ( string $message ) : TView Set an error message
setMessage ( string $message, string $type ) : TView To set a message
unassign ( $key ) : Api To unassign variable by key name

Method Details

assign() public method

Assign variable
public assign ( mixed $key, mixed $val = "" ) : Api
$key mixed - can be string, dot notation k/v, or array to set data as bulk
$val mixed - can be string, numeric, array
return Api

getAssigned() public method

Get all the assigned vars
public getAssigned ( ) : Array
return Array

getMessage() public method

To return the messages saved
public getMessage ( string $type ) : Array | null
$type string - message type: error, success
return Array | null | null

getMessages() public method

Return all the messages
public getMessages ( ) : Array
return Array

hasError() public method

Check if error exist
public hasError ( ) : boolean
return boolean

setError() public method

Set an error message
public setError ( string $message ) : TView
$message string
return TView

setMessage() public method

To set a message
public setMessage ( string $message, string $type ) : TView
$message string - the message
$type string - The type of message: error, success
return TView

unassign() public method

To unassign variable by key name
public unassign ( $key ) : Api
return Api

Property Details

$assigned protected property

protected $assigned

$messages protected property

protected $messages