\Pluf_Template

Render a template file.

Summary

Methods
Properties
Constants
__construct()
render()
getCompiledTemplateName()
write()
markSafe()
$tpl
$folders
$cache
$compiled_template
$template_content
$context
$class
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$tpl

$tpl : 

Type

$folders

$folders : 

Type

$cache

$cache : 

Type

$compiled_template

$compiled_template : 

Type

$template_content

$template_content : 

Type

$context

$context : 

Type

$class

$class : 

Type

Methods

__construct()

__construct(  $template,   $folders = null,   $cache = null) 

Constructor.

If the folder name is not provided, it will default to Pluf::f('template_folders') If the cache folder name is not provided, it will default to Pluf::f('tmp_folder')

Parameters

$template
$folders
$cache

render()

render(  $c = null) 

Render the template with the given context and return the content.

Parameters

$c

getCompiledTemplateName()

getCompiledTemplateName() : string

Get the full name of the compiled template.

Ends with .phps to prevent execution from outside if the cache folder is not secured but to still have the syntax higlightings by the tools for debugging.

Returns

string —

Full path to the compiled template

write()

write(  $name) : boolean

Write the compiled template in the cache folder.

Throw an exception if it cannot write it.

Parameters

$name

Returns

boolean —

Success in writing

markSafe()

markSafe(  $string) 

Parameters

$string