Tuskfish API
  • Package
  • Class

Packages

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

Classes

  • TfishArticle
  • TfishArticleHandler
  • TfishAudio
  • TfishAudioHandler
  • TfishBlock
  • TfishBlockHandler
  • TfishCollection
  • TfishCollectionHandler
  • TfishContentHandler
  • TfishContentObject
  • TfishDownload
  • TfishDownloadHandler
  • TfishImage
  • TfishImageHandler
  • TfishMetadata
  • TfishRss
  • TfishStatic
  • TfishStaticHandler
  • TfishTag
  • TfishTagHandler
  • TfishTaglink
  • TfishTaglinkHandler
  • TfishTemplate
  • TfishVideo
  • TfishVideoHandler

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.

Package: content
Copyright: Simon Wilkinson 2013-2017 (https://tuskfish.biz)
License: GNU General Public License (GPL) V2
Author: Simon Wilkinson simon@isengard.biz
Version: Release: 1.0
Since: 1.0
Located at trust_path/libraries/tuskfish/class/TfishTemplate.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.

Tuskfish API API documentation generated by ApiGen