nyroFwk  0.2
Public Member Functions | Protected Member Functions | Protected Attributes
tpl Class Reference
Inheritance diagram for tpl:
object

Public Member Functions

 getResponseProxy ()
 
 get ($name)
 
 set ($name, $value)
 
 setA (array $values)
 
 reset ()
 
 fetch (array $prm=array())
 
 render ($prm)
 
 __toString ()
 
 __get ($name)
 
 __set ($name, $val)
 
 getAttr ($name)
 
 setAttr ($name, $value)
 
 getCfg ()
 

Protected Member Functions

 afterInit ()
 
 _fetch ($file)
 
 findTpl (array $prm, array $name)
 
 beforeInit ()
 

Protected Attributes

 $vars = array()
 
 $responseProxy
 
 $cfg
 

Detailed Description

Template

Definition at line 10 of file tpl.class.php.

Member Function Documentation

◆ __get()

__get (   $name)

Get a variable, with a convenient way $tpl->name

Parameters
string$nameName to set
Returns
mixed|null The value or null if not existing
See also
get

Definition at line 219 of file tpl.class.php.

◆ __set()

__set (   $name,
  $val 
)

Set a variable, with a convenient way $tpl->name = $value

Parameters
string$nameName to set
mixed$valueValue to set
See also
set

Definition at line 230 of file tpl.class.php.

◆ __toString()

__toString ( )

Fetch the tpl

Returns
string
See also
fetch

Definition at line 208 of file tpl.class.php.

◆ _fetch()

_fetch (   $file)
protected

Make really the fetch

Parameters
string$fileTemplate file path
Returns
string Content fetched

Definition at line 155 of file tpl.class.php.

◆ afterInit()

afterInit ( )
protected

Definition at line 26 of file tpl.class.php.

◆ beforeInit()

beforeInit ( )
protectedinherited

Call just before the configuration initialisation

Definition at line 35 of file object.class.php.

◆ fetch()

fetch ( array  $prm = array())

Fetch the template

Parameters
array$prmArray parameter for retrieve the tpl file (exemple: used to force the tpl extension via tplExt) return string The result fetched
See also
file::nyroExists

Definition at line 83 of file tpl.class.php.

◆ findTpl()

findTpl ( array  $prm,
array  $name 
)
protected

Find the template file

Parameters
array$prmParameter used in file::nyroExists
array$nameTemplate name
Returns
string|null The first template file path found or null

Definition at line 172 of file tpl.class.php.

◆ get()

get (   $name)

Get a variable value for the fetch

Parameters
string$nameVariable name
Returns
mixed|null The value or null if not existing

Definition at line 45 of file tpl.class.php.

◆ getAttr()

getAttr (   $name)
inherited

Get an attribute

Parameters
string$nameAttribute name
Returns
mixed|null The attribute or null if not set

Definition at line 48 of file object.class.php.

◆ getCfg()

getCfg ( )
inherited

Get the configuration object

Returns
config

Definition at line 67 of file object.class.php.

◆ getResponseProxy()

getResponseProxy ( )

Get the response proxy used in this tpl

Returns
response_proxy

Definition at line 35 of file tpl.class.php.

◆ render()

render (   $prm)

Render an other tpl. To be used inside the tpl

Parameters
array$prmPossibile keys:

Definition at line 188 of file tpl.class.php.

◆ reset()

reset ( )

Clear all the variables

Definition at line 72 of file tpl.class.php.

◆ set()

set (   $name,
  $value 
)

Set a variable for the fecth

Parameters
string$nameVariable name
mixed$valueThe value

Definition at line 55 of file tpl.class.php.

◆ setA()

setA ( array  $values)

Set multiple variables using an array

Parameters
array$valuesThe values
See also
set

Definition at line 65 of file tpl.class.php.

◆ setAttr()

setAttr (   $name,
  $value 
)
inherited

Set an attribute

Parameters
string$nameAttribute name
mixed$valueAttribute value

Definition at line 58 of file object.class.php.

Field Documentation

◆ $cfg

$cfg
protectedinherited

Definition at line 17 of file object.class.php.

◆ $responseProxy

$responseProxy
protected

Definition at line 24 of file tpl.class.php.

◆ $vars

$vars = array()
protected

Definition at line 17 of file tpl.class.php.


The documentation for this class was generated from the following file:
Generated on Sun Oct 15 2017 22:25:21 for nyroFwk by doxygen 1.8.13