There are two global references to access preset variables or methods. For example to get a preset hello_world variable you can access in the templates via one of the following ways:
echo $theme->hello_world;
echo $page_data["hello_world"];
Variable
Methods
Template::img
The base url and location of images is set by the Template class. All you have to define is the location of the image in the respecitve theme/img folder.
- $file - string, location of the file in the theme img folder
- $title - string, image title attribute
- $id - string, image id attribute
- $class - string, image class attribute
- $other_attr - string, other attributes in standar HTML format (e.g., 'style="padding:10px;"')
Example:
$theme->img("icon-close.png", "Close ME", "i-better-be-unique", "a-classy-class","data-something=\"other attributes here\"" );
// An image with just a class
$theme->img("icon-close.png", "", "", "a-classy-class" );
// Proposed method. NOT FUNCTIONAL YET
$theme->img(array("file"=>"icon-close.png","class"=>"a-classy-class"));
$theme->