This object is used to render page

uses implements the singleton pattern
uses the exceptions handler
uses check cache directories
uses templates tools
package OWR
used_by \OWR\Includes\Themes\OriginalDark\Theme
used_by \OWR\Includes\Themes\Original\Theme
used_by \OWR\REST\Controller
used_by \OWR\Controller
used_by \OWR\Theme

 Methods

Returns translated text

_(string $name) : string
access public

Parameters

$name

string

name of the text

Returns

stringtranslated text

Cloning is denied This function can NOT be overloaded

__clone() 
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::__clone()

Executed when an object is unserialized We register the new object

__wakeUp() 
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::__wakeUp()

Adds a block to the stack

addBlock(string $name, string $layout, string $content, string $type) 
access public

Parameters

$name

string

name of the block

$layout

string

name of the layout containing the block

$content

string

content of the block

$type

string

type of the block

Adds HTTP headers

addHeaders(array $headers, boolean $send) 
access public
author Pierre-Alain Mignot

Parameters

$headers

array

associated array of HTTP header

$send

boolean

must-we send headers ?

Returns the specified template with the specified datas

get(string $tpl, array $datas, int $cacheTime, array $noCacheDatas) : string
access public
author Pierre-Alain Mignot

Parameters

$tpl

string

the template name

$datas

array

the datas

$cacheTime

int

cache time in seconds

$noCacheDatas

array

the datas that are not cached but replaced on-the-fly

Returns

stringthe template rendered

Returns a block from a layout

getBlock(string $name, string $layout) : string
access public

Parameters

$name

string

name of the block

$layout

string

name of the layout containing the block

Returns

stringblock content from the layout or null

Returns all blocks from a layout

getBlocks(string $layout) : string
access public

Parameters

$layout

string

name of the layout

Returns

stringlayout content or null

Returns the added microtime of all rendering processing

getTime() : float
Static
access public
author Pierre-Alain Mignot
static

Returns

float$_renderingTime

Instance getter This function can NOT be overloaded

iGet() : mixed
InheritedStatic
access public
static
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::iGet()

Returns

mixedthe instance

Register function This function is called when an object is unserialized and is used to register the instance of the object This function can NOT be overloaded

register(mixed $instance) 
InheritedStatic
access public
static
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::register()

Parameters

$instance

mixed

the instance to register

Prints the page This function tries to encode the contents

render(string $page) 
access public
author Pierre-Alain Mignot

Parameters

$page

string

the page to display

Renders a block from a layout

renderBlock(string $name, string $layout) 
access public

Parameters

$name

string

name of the block

$layout

string

name of the layout containing the block

Renders blocks from a layout

renderBlocks(string $layout) 
access public

Parameters

$layout

string

name of the layout containing the block

Sends HTTP headers

sendHeaders(boolean $sendStatus) 
access public
author Pierre-Alain Mignot

Parameters

$sendStatus

boolean

set to false to not send HTTP status code

Sets HTTP status code

setStatusCode(int $statusCode, boolean $send) 
access public
author Pierre-Alain Mignot

Parameters

$statusCode

int

the code to set

$send

boolean

must-we send headers ?

Constructor Checks cache directories and set OWR\View\Utilities instance

__construct() 
access protected
author Pierre-Alain Mignot

Executes specified template and returns generated content

_execute(string $tpl, array $datas, array $noCacheDatas) : string
access public
author Pierre-Alain Mignot

Parameters

$tpl

string

the template name

$datas

array

the datas

$noCacheDatas

array

the datas that are not cached but replaced on-the-fly

Returns

stringthe template rendered

 Properties

 

stack of templates blocks

$_blocks : array
access protected
 

list of headers

$_headers : array
access protected
 

rendering time

$_renderingTime : float
access protected
 

HTTP status code

$_statusCode : int
access protected
 

instance of OWR\View\Utilities

$_utilities : mixed
access protected
 

store instancied objects

$_instances : array
Inherited
access private
static
inherited_from \OWR\Singleton::$$_instances