PHP Class Ip\View

Show file Open project: impresspages/impresspages

Protected Properties

Property Type Description
$overrides

Public Methods

Method Description
__construct ( string $file, array $data = [] ) Construct view object using specified file and data.
__toString ( ) : string PHP can't handle exceptions in __toString method. Try to avoid it every time possible. Use render() method instead.
clearOverride ( $source ) Clear registered view file override
getDoctype ( ) : mixed Return DOCTYPE declaration.
getThemeOption ( $name, null $default = null ) : string Get theme option. Options can be viewed or set using UI via Theme options dialog box.
getVariable ( $name ) : null Get view variable value
getVariables ( ) : array Get view variables
registerOverride ( string $source, string $destination ) Register view file override
render ( ) : string Render a view and return HTML, XML, or any other string.
setDoctype ( $doctype ) Set DOCTYPE declaration.
setVariable ( string $name, $value ) Set a single view variable
setVariables ( $variables ) Set view variables
unsetVariable ( $name ) Unset a view variable

Private Methods

Method Description
checkData ( $data )

Method Details

__construct() public method

Construct view object using specified file and data.
public __construct ( string $file, array $data = [] )
$file string Path to view file. Relative to file where this constructor is executed from.
$data array Array of data to pass to view

__toString() public method

PHP can't handle exceptions in __toString method. Try to avoid it every time possible. Use render() method instead.
public __toString ( ) : string
return string

clearOverride() public static method

Clear registered view file override
public static clearOverride ( $source )
$source

getDoctype() public method

Return DOCTYPE declaration.
public getDoctype ( ) : mixed
return mixed

getThemeOption() public method

Get theme option. Options can be viewed or set using UI via Theme options dialog box.
public getThemeOption ( $name, null $default = null ) : string
$name
$default null
return string

getVariable() public method

Get view variable value
public getVariable ( $name ) : null
$name
return null

getVariables() public method

Get view variables
public getVariables ( ) : array
return array

registerOverride() public static method

Register view file override
public static registerOverride ( string $source, string $destination )
$source string absolute path to the view file to be overriden
$destination string absolute path to the new view file

render() public method

Render a view and return HTML, XML, or any other string.
public render ( ) : string
return string

setDoctype() public method

Set DOCTYPE declaration.
public setDoctype ( $doctype )
$doctype

setVariable() public method

Set a single view variable
public setVariable ( string $name, $value )
$name string
$value

setVariables() public method

Set view variables
public setVariables ( $variables )
$variables

unsetVariable() public method

Unset a view variable
public unsetVariable ( $name )
$name

Property Details

$overrides protected static property

protected static $overrides