Template
in package
System Template class Each Template consists of an <name>.html and <name>.json The JSON defines all Placeholders used in the Template and the default values.
Templates can be included in each other, while the content of the inner goes to: %%INNERCONTAINER%%
Table of Contents
- $allLangs : mixed
- $filename : mixed
- Name, Placeholderdata and included Template
- $inner : mixed
- $lang : mixed
- $multiples : mixed
- $multiples_data : mixed
- $placeholder : mixed
- $serverURL : mixed
- __construct() : mixed
- Create an new Template
- getOutputString() : string
- Getting the output of this template (incl. included ones)
- includeTemplate() : bool
- Includes a Tempalte in this. (Output of included on will be put in %%INNERCONTAINER%%)
- loadOtherTemplate() : void
- Change the loaded Template file (only the html is changed, uses the first json)
- output() : void
- Output the page using this template.
- setContent() : bool
- Setting the content for one of the placeholders
- setLanguage() : void
- Change the language of the site see $allLangs for list
- setMultipleContent() : bool
- Sets the content for one type of multiple page elements
- setServerURL() : void
- Set the default value for the placeholder %%SERVERURL%%.
Properties
$allLangs
private
static mixed
$allLangs
= array('de')
$filename
Name, Placeholderdata and included Template
private
mixed
$filename
= ''
$inner
private
mixed
$inner
=
ull
$lang
private
static mixed
$lang
= 'de'
$multiples
private
mixed
$multiples
= array()
$multiples_data
private
mixed
$multiples_data
= array()
$placeholder
private
mixed
$placeholder
= array()
$serverURL
private
static mixed
$serverURL
= ''
Methods
__construct()
Create an new Template
public
__construct(string $name) : mixed
Parameters
- $name : string
Return values
mixed —getOutputString()
Getting the output of this template (incl. included ones)
public
getOutputString() : string
Return values
string —includeTemplate()
Includes a Tempalte in this. (Output of included on will be put in %%INNERCONTAINER%%)
public
includeTemplate( $template) : bool
Parameters
Return values
bool —loadOtherTemplate()
Change the loaded Template file (only the html is changed, uses the first json)
public
loadOtherTemplate(string $name) : void
Parameters
- $name : string
Return values
void —output()
Output the page using this template.
public
output() : void
ends the script!
Return values
void —setContent()
Setting the content for one of the placeholders
public
setContent( $key, $value) : bool
Parameters
Return values
bool —setLanguage()
Change the language of the site see $allLangs for list
public
static setLanguage(string $lang) : void
Parameters
- $lang : string
Return values
void —setMultipleContent()
Sets the content for one type of multiple page elements
public
setMultipleContent( $name, $content) : bool
Parameters
- $name :
-
the name of the multiple page element
- $content :
-
the content for each part as array array( array( "key" => "val", //... ) //... )
Return values
bool —setServerURL()
Set the default value for the placeholder %%SERVERURL%%.
public
static setServerURL( $url) : void
%%SERVERURL%% will be always replaced in all Template files.