Gumbo_Template_Special
Special Abstract Template Class
This is a special element of Templates. It will typically define a part of the program that commonly appears on every View. The best example is a Header and Footer. There can only be one Special Template element. All Special Template classes should implement Singleton. This will make the object accessible everywhere.
For example, if the Header defines a navigation menu that changes with the different areas of an application. Each area has a special menu it defines. The Special_Header would load the main menu by default, allowing the application to change the menu as necessary. This is a simple example (if the program uses menus). The programmer could simply define a Special_Menu class. It depends on the application needs.
The Special elements could be processed when outputting the main Template contents, or by simply assigning the element to a Template_Engine and defining it's location inside the Template file. It's really at the programmer's discretion.
ELEMENTS These are special objects (Gumbo_Template_Engine) that are assigned to the Special Template. By assigning an Element, the program can manipulate the object by retrieving the element. This will separate standard Template variable assignment from element assignment. It ensures that the returning element is a Gumbo_Template_Engine.
BASIC FILE (optional) This file is loaded when the Special Template object is inactive. If no file is defined, the output should be blank. The basic file is a cut-down version or simplified display. For example, the main Header is used for the primary website, but the basic Header is used to show a printable view on screen. (This should be handled with CSS, but it's a quick example).
Author(s): |
Michael Luster <mluster79@yahoo.com> |
License: | New BSD License |
Copyright: | Copyright (c) 2007, iBayou, Michael Luster |
Link: | http://sourceforge.net/projects/phpgumbo |
Version: | 0.0.1 |
Implements interfaces:
Child classes:
Class Variables
Class Methods
Assigns a template variable with a value (wrapper to Gumbo_Template_Engine::assign())
Parameter(s):
- (string|array) $key :: template file reference
- (mixed) $val
[ Top ]
Assigns an Element to the template
Parameter(s):
- (string) $key
- (Gumbo_Template_Engine) $obj
- throws:
Gumbo_Exception
[ Top ]Returns the Template_Engine element
Parameter(s):
- (string) $key
- throws:
Gumbo_Exception
[ Top ]public Gumbo_Interface_Template_Engine[] getElements ( ) [line 248]Returns the list of elements
[ Top ]protected Gumbo_Template_Engine getEngine ( ) [line 200]Returns the Special Template's Template_Engine
[ Top ]protected void setEngine ( Gumbo_Template_Engine $engine ) [line 145]Sets the Template_Engine object
Parameter(s):
- (Gumbo_Template_Engine) $engine
[ Top ]public void setFile ( string $file ) [line 154]Sets the standard file (full path)
Parameter(s):
- (string) $file
- throws:
Gumbo_Exception
[ Top ]public void setFileBasic ( string|null $file ) [line 176]Sets the basic file (full path)
Parameter(s):
- (string|null) $file
- throws:
Gumbo_Exception
[ Top ]!isActive()
[ Top ]isActive()
[ Top ]