Chyrp

Theme

Various helper functions for the theming engine.

Summary
Theme Various helper functions for the theming engine.
Variables
$title The title for the current page.
$twig Contains the Twig_Loader instance.
Functions
__construct Loads the Twig parser into Theme, and sets up the theme l10n domain.
pages_list Returns a simple array of list items to be used by the theme to generate a recursive array of pages.
get_last_linear_child Helper function to Theme.pages_list
recurse_pages Helper function to Theme.pages_list
archive_list Generates an array of all of the archives, by month.
file_exists Returns whether the specified Twig file exists or not.
stylesheets Outputs the default stylesheet links.
javascripts Outputs the default JavaScript script references.
feeds Outputs the Feed references.
current Returns a singleton reference to the current class.

Variables

$title

public $title

The title for the current page.

$twig

private $twig

Contains the Twig_Loader instance.

Functions

__construct

private function __construct()

Loads the Twig parser into Theme, and sets up the theme l10n domain.

pages_list

public function pages_list()

Returns a simple array of list items to be used by the theme to generate a recursive array of pages.

get_last_linear_child

public function get_last_linear_child( $page,   
$origin  =  null )

Helper function to Theme.pages_list

recurse_pages

public function recurse_pages( $page )

Helper function to Theme.pages_list

archive_list

Generates an array of all of the archives, by month.

Parameters

$limit Amount of months to list
$order_by What to sort it by
$order ”asc” or “desc”

Returns

$archives The array.  Each entry as “month”, “year”, and “url” values, stored as an array.

file_exists

public function file_exists( $file )

Returns whether the specified Twig file exists or not.

Parameters

$file The file’s name

stylesheets

public function stylesheets()

Outputs the default stylesheet links.

javascripts

public function javascripts()

Outputs the default JavaScript script references.

feeds

public function feeds()

Outputs the Feed references.

current

public static function & current()

Returns a singleton reference to the current class.