Public Member Functions | Static Public Member Functions | Data Fields
Template Class Reference

Provides control over view files. More...

Inheritance diagram for Template:
Dispersion

Public Member Functions

 getLoadedLibraries ()
 
 initLib ($lib, $value)
 
 insertView ($viewfile, $index=-1)
 
 render ()
 
 setCssPath ($css_file_loc)
 
 setJsPath ($js_file_loc)
 
 css ($name)
 
 js ($name)
 
- Public Member Functions inherited from Dispersion
 Dispersion ()
 
 emptyLayout ()
 
 set ($name, $value)
 
 _set ($name, $value)
 
 insertView ($name, $index=-1)
 

Static Public Member Functions

static getInstance ($modelob=null, $debugob=null, $locations=array(), $autoload=array())
 

Data Fields

 $loaded_libs = array()
 
 $loaded_libs_loc = array()
 
 $content_counter = 0
 
 $js_file_loc = BASEPATH
 
 $css_file_loc = BASEPATH
 
 $view_file_ext = '.php'
 
 $view_file_loc = ''
 
 $instance = null
 
- Data Fields inherited from Dispersion
 $model_ob = null
 
 $debug_ob = null
 
 $_variables = array()
 
 $_content = array()
 
 $_content_count = 0
 
 $model
 
 $debug
 

Additional Inherited Members

- Protected Member Functions inherited from Dispersion
 requireConfigFile ($file_name, $required=false)
 

Detailed Description

Provides control over view files.

Version
1.1
Author
DinuSV

Contains all view files to be rendered. Stores default header and footer used throughout the site. Offers access to loaded libraries and models for view files.

Member Function Documentation

static getInstance (   $modelob = null,
  $debugob = null,
  $locations = array(),
  $autoload = array() 
)
static

Singleton class

Parameters
$modelobstring : model object
$debugobstring : the full path to the js files
$locationsarray : path to view files
$autoloadarray : autoloaded files & libraries
getLoadedLibraries ( )
Returns
: array of loaded libraries
initLib (   $lib,
  $value 
)

Function used by controller to initialise the libraries

Parameters
$libstring : the library name
$valueobject : library object
insertView (   $viewfile,
  $index = -1 
)

Insert a view file

Overrides Dispersion::insertView($viewfile, $index = -1)

Parameters
string$viewfile: name of the file
numeric$index: override required argument
Exceptions
FileNotFoundException
render ( )

Loads the set of view files

Exceptions
FileNotFoundException
setCssPath (   $css_file_loc)

Set location for the css files

Parameters
$css_file_locstring
setJsPath (   $js_file_loc)

Set location for the javascript files

Parameters
$js_file_locstring
css (   $name)

Print css file

Parameters
$namestring : css file name with relative path
js (   $name)

Print js file

Parameters
$namestring : js file name with relative path

Field Documentation

$loaded_libs = array()

array : Stores the loaded libraries

$loaded_libs_loc = array()

array : Stores the locations to load the libs

$content_counter = 0

int : Stores the number of view files added

$js_file_loc = BASEPATH

string : Stores the location of the javascript files

$css_file_loc = BASEPATH

string : Stores the location of the css files

$view_file_ext = '.php'

string : Extension of the view files

$view_file_loc = ''

string : Stores the location of the view files

$instance = null

Template : Singleton instance