Class TfishTemplate
Tuskfish template object.
Used to hold template variables and to render templates for display. A template object is
automatically made available on every page via tfish_header.php.
Methods summary
public
mixed|null
|
#
__get( string $property )
Get the value of a property.
Get the value of a property.
Intercepts direct calls to access an object property. This method can be modified to impose
processing logic to the value before returning it.
Parameters
- $property
- Name of Property.
Returns
mixed|null $property Value of property if it is set; otherwise null.
|
public
boolean
|
#
__isset( string $property )
Check if a property is set.
Check if a property is set.
Intercepts isset() calls to correctly read object properties. Can be modified to add
processing logic to specific properties.
Parameters
- $property
- Name of property.
Returns
boolean True if set, otherwise false.
|
public
string
|
#
render( string $template )
Renders a HTML template file for display.
Renders a HTML template file for display.
Extracts all properties assigned to the template object as variables and includes the
designated template file. The extracted variables are used to populate the dynamic sections
of the template. Templates can be nested by assigning a rendered child template as a property
of a parent template object.
Parameters
- $template
- Name of the template file in the /themes/sometemplate directory.
Returns
string Rendered HTML template.
|
public
|
#
__set( string $property, mixed $value )
Set the value of an object property.
Set the value of an object property.
Do not declare variables named $theme or it will disrupt this method.
Parameters
- $property
- Name of property.
- $value
- Value to assign to property.
|
public
|
#
setTheme( string $theme )
Set the theme (template set) to be used.
Set the theme (template set) to be used.
The theme must be specified through this method. This is a safety measure to prevent
someone accidentally overwriting the template set when assigning a variable to the template
object (if content were assigned to $tfish_template->setTheme() it would mess things up).
Parameters
- $theme
- Name of theme (alphanumeric and underscore characters only).
|
public
boolean
|
#
__unset( string $property )
Unsets an object property.
Unsets an object property.
Intercepts unset() calls to correctly unset object properties. Can be modified to add
processing logic for specific properties.
Parameters
- $property
- Name of property.
Returns
boolean True on success, false on failure.
|
Properties summary
protected
array
|
$__data
$__data Array holding values of this object's properties.
$__data Array holding values of this object's properties.
|
#
array(
'theme' => 'default'
)
|
Magic properties
public
string
|
$theme
The theme (template set) in use on this page.
|