Documentation

View extends ArrayObject
in package
Uses FilterableTrait

View class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
3.3.0

Table of Contents

$data  : array<string|int, mixed>
Model data
$filters  : array<string|int, mixed>
Form filters
$output  : string
View output string
$template  : TemplateInterface
View template object
__construct()  : mixed
Constructor
__get()  : mixed
Get a value
__isset()  : bool
Is value set
__serialize()  : string
Serialize megic method
__set()  : ArrayObject
Set a value
__toString()  : string
Return rendered view as string
__unserialize()  : ArrayObject
Unserialize magic method
__unset()  : void
Unset a value
addFilter()  : FilterableTrait
Add filter
addFilters()  : FilterableTrait
Add filters
clearFilters()  : FilterableTrait
Clear filters
count()  : int
Method to get the count of the array object
createFromJson()  : ArrayObject
Create array object from JSON string
createFromSerialized()  : ArrayObject
Create array object from serialized string
filter()  : mixed
Filter values
filterAll()  : array<string|int, mixed>
Filter all values, ignoring excludes
get()  : mixed
Get data
getData()  : array<string|int, mixed>
Get all model data
getFilters()  : array<string|int, mixed>
Get filters
getIterator()  : ArrayIterator
Method to iterate over the array object
getOutput()  : string
Get rendered output
getTemplate()  : TemplateInterface
Get view template
hasFilters()  : bool
Has filters
hasTemplate()  : bool
Has a view template
isFile()  : bool
Is view template a file
isStream()  : bool
Is view template a stream
jsonSerialize()  : string
JSON serialize the array object
jsonUnserialize()  : ArrayObject
Unserialize a JSON string
merge()  : View
Merge new model data
offsetExists()  : bool
ArrayAccess offsetExists
offsetGet()  : mixed
ArrayAccess offsetGet
offsetSet()  : void
ArrayAccess offsetSet
offsetUnset()  : void
ArrayAccess offsetUnset
render()  : mixed
Render the view
serialize()  : string
Serialize the array object
set()  : View
Set model data
setData()  : View
Set all model data
setTemplate()  : View
Set view template
toArray()  : array<string|int, mixed>
Get the values as an array
unserialize()  : ArrayObject
Unserialize a string

Properties

$data

Model data

protected array<string|int, mixed> $data = []

$filters

Form filters

protected array<string|int, mixed> $filters = []

$output

View output string

protected string $output = null

Methods

__construct()

Constructor

public __construct([mixed $template = null ][, array<string|int, mixed> $data = null ][, mixed $filters = null ]) : mixed

Instantiate the view object

Parameters
$template : mixed = null
$data : array<string|int, mixed> = null
$filters : mixed = null
Return values
mixed

__get()

Get a value

public __get(string $name) : mixed
Parameters
$name : string
Return values
mixed

__isset()

Is value set

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__serialize()

Serialize megic method

public __serialize() : string
Return values
string

__toString()

Return rendered view as string

public __toString() : string
Return values
string

__unserialize()

Unserialize magic method

public __unserialize(array<string|int, mixed> $data) : ArrayObject
Parameters
$data : array<string|int, mixed>
Return values
ArrayObject

__unset()

Unset a value

public __unset(string $name) : void
Parameters
$name : string
Return values
void

count()

Method to get the count of the array object

public count() : int
Return values
int

createFromJson()

Create array object from JSON string

public static createFromJson(string $jsonString[, int $depth = 512 ], int $options) : ArrayObject
Parameters
$jsonString : string
$depth : int = 512
$options : int
Return values
ArrayObject

createFromSerialized()

Create array object from serialized string

public static createFromSerialized(string $string) : ArrayObject
Parameters
$string : string
Return values
ArrayObject

filter()

Filter values

public filter(mixed $values) : mixed
Parameters
$values : mixed
Return values
mixed

filterAll()

Filter all values, ignoring excludes

public filterAll(array<string|int, mixed> $values) : array<string|int, mixed>
Parameters
$values : array<string|int, mixed>
Return values
array<string|int, mixed>

get()

Get data

public get(string $key) : mixed
Parameters
$key : string
Return values
mixed

getData()

Get all model data

public getData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFilters()

Get filters

public getFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getIterator()

Method to iterate over the array object

public getIterator() : ArrayIterator
Return values
ArrayIterator

getOutput()

Get rendered output

public getOutput() : string
Return values
string

hasFilters()

Has filters

public hasFilters() : bool
Return values
bool

hasTemplate()

Has a view template

public hasTemplate() : bool
Return values
bool

isFile()

Is view template a file

public isFile() : bool
Return values
bool

isStream()

Is view template a stream

public isStream() : bool
Return values
bool

jsonSerialize()

JSON serialize the array object

public jsonSerialize(int $options[, int $depth = 512 ]) : string
Parameters
$options : int
$depth : int = 512
Return values
string

jsonUnserialize()

Unserialize a JSON string

public jsonUnserialize(string $jsonString[, int $depth = 512 ], int $options) : ArrayObject
Parameters
$jsonString : string
$depth : int = 512
$options : int
Return values
ArrayObject

merge()

Merge new model data

public merge(array<string|int, mixed> $data) : View
Parameters
$data : array<string|int, mixed>
Return values
View

offsetExists()

ArrayAccess offsetExists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

ArrayAccess offsetGet

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed
Return values
mixed

offsetSet()

ArrayAccess offsetSet

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Return values
void

offsetUnset()

ArrayAccess offsetUnset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Return values
void

render()

Render the view

public render() : mixed
Tags
throws
Exception
Return values
mixed

serialize()

Serialize the array object

public serialize([bool $self = false ]) : string
Parameters
$self : bool = false
Return values
string

set()

Set model data

public set(string $name, mixed $value) : View
Parameters
$name : string
$value : mixed
Return values
View

setData()

Set all model data

public setData([array<string|int, mixed> $data = [] ]) : View
Parameters
$data : array<string|int, mixed> = []
Return values
View

setTemplate()

Set view template

public setTemplate(mixed $template) : View
Parameters
$template : mixed
Return values
View

toArray()

Get the values as an array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results