Tuskfish API V1.1.2
  • Package
  • Class

Packages

  • content
  • core
  • database
  • installation
  • security
  • user
  • utilities

Classes

  • TfCache
  • TfFileHandler
  • TfLogger
  • TfMetadata
  • TfPaginationControl
  • TfPreference
  • TfPreferenceHandler
  • TfTemplate
  • TfTree

Traits

  • TfLanguage
  • TfMagicMethods
  • TfMimetypes
  • TfRights

Functions

  • checkPasswordStrength
  • hashPassword
  • tf_autoload
  • tfContentModuleAutoload

Class TfTemplate

Used to hold variables that will be inserted into templates and to render templates for display.

A template object is automatically made available on every page via tfHeader.php.

Package: core
Copyright: Simon Wilkinson 2013+ (https://tuskfish.biz)
License: GNU General Public License (GPL) V2
Author: Simon Wilkinson simon@isengard.biz
Version: Release: 1.0
Since: 1.0
Var: TfValidator $tfValidator Instance of the Tuskfish data validator class.
Var: string $theme The theme (template set) in use on this page.
Located at trust_path/libraries/tuskfish/class/TfTemplate.php

Methods summary

public
# __construct( TfValidator $validator )

Constructor.

Constructor.

Parameters

$validator
An instance of the Tuskfish data validator class.
public string
# getTheme( )

Retrieve the name of the theme in use on this page.

Retrieve the name of the theme in use on this page.

Returns

string
Returns the the name of the theme in use.
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
# 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 $tfTemplate->setTheme() it would mess things up).

Parameters

$theme
Name of theme (alphanumeric and underscore characters only).

Properties summary

protected $tfValidator
#
protected string $theme
# 'default'
Tuskfish API V1.1.2 API documentation generated by ApiGen