Jeff PHP framework  0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
view Class Reference

View class of the MVC pattern, is the class used to manage the module's views. More...

Public Member Functions

 __construct ()
 Constructs a view instance.
 assign ($name, $value)
 Defines template variables with their values.
 render ()
 Generates the html output of the templates parsing all the template variables. Adds the asset calls if present.
 setAssets ($assets)
 Setter method for the $_asset property.
 setTpl ($tpl, $opts=null)
 Sets the view template.

Protected Member Functions

 asset ($path, $type)
 Returns the javascript code needed to asynchronously load the given css or js.

Protected Attributes

 $_assets
 associative array containing the js and css to include asynchronously in the document
 $_css_folder
 the path to the folder containing the css of the active theme
 $_data
 the standard class objects which contains the view context
 $_dft_css_folder
 the path to the folder containing the css of the default theme (fallback purposes)
 $_dft_view_folder
 the path to the folder containing the view of the default theme (fallback purposes)
 $_registry
 the registry singleton instance
 $_view_folder
 the path to the folder containing the view of the active theme

Detailed Description

View class of the MVC pattern, is the class used to manage the module's views.

This is the general view class used by module controllers.
It acts like an template engine at module level. the module templates are evaluated using the context variables assigned by the controller.

Author:
abidibo abidi.nosp@m.bo@g.nosp@m.mail..nosp@m.com
Version:
0.99
Date:
2011-2012

Definition at line 26 of file view.class.php.


Constructor & Destructor Documentation

Constructs a view instance.

Initializes some class members

Returns:
view instance

Definition at line 70 of file view.class.php.

+ Here is the call graph for this function:


Member Function Documentation

view::asset ( path,
type 
) [protected]

Returns the javascript code needed to asynchronously load the given css or js.

Parameters:
string$paththe relative file path
string$typethe file type (css | js)
Returns:
the asset javascript code

Definition at line 159 of file view.class.php.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

view::assign ( name,
value 
)

Defines template variables with their values.

Prepares the context to use in the template.

Parameters:
string$namethe name of the template variable
mixed$valuethe valueof the template variable
Returns:
void

Definition at line 125 of file view.class.php.

Generates the html output of the templates parsing all the template variables. Adds the asset calls if present.

Returns:
the template output (html)

Definition at line 134 of file view.class.php.

+ Here is the call graph for this function:

view::setAssets ( assets)

Setter method for the $_asset property.

Parameters:
mixed$assetsarray in the form array('asset_path'=>'asset_type'). The 'asset_type' may be 'css' or 'js'.
Returns:
void

Definition at line 112 of file view.class.php.

view::setTpl ( tpl,
opts = null 
)

Sets the view template.

Searches for the given template in the active theme view folder, than in the deafult theme view folder. If can't find it returns an error.
Adds a stylesheet if passed through the opts parameter.

Parameters:
string$tplthe template name
array$optsan associative array of options
  • css: the stylesheet to charge with the template
Returns:
void

Definition at line 92 of file view.class.php.

+ Here is the call graph for this function:


Field Documentation

view::$_assets [protected]

associative array containing the js and css to include asynchronously in the document

Definition at line 41 of file view.class.php.

view::$_css_folder [protected]

the path to the folder containing the css of the active theme

Definition at line 56 of file view.class.php.

view::$_data [protected]

the standard class objects which contains the view context

Definition at line 31 of file view.class.php.

the path to the folder containing the css of the default theme (fallback purposes)

Definition at line 61 of file view.class.php.

the path to the folder containing the view of the default theme (fallback purposes)

Definition at line 51 of file view.class.php.

view::$_registry [protected]

the registry singleton instance

Definition at line 36 of file view.class.php.

view::$_view_folder [protected]

the path to the folder containing the view of the active theme

Definition at line 46 of file view.class.php.


The documentation for this class was generated from the following file: