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 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 |
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.
Definition at line 26 of file view.class.php.
Constructs a view instance.
Initializes some class members
Definition at line 70 of file view.class.php.
view::asset | ( | $ | path, |
$ | type | ||
) | [protected] |
Returns the javascript code needed to asynchronously load the given css or js.
string | $path | the relative file path |
string | $type | the file type (css | js) |
Definition at line 159 of file view.class.php.
view::assign | ( | $ | name, |
$ | value | ||
) |
Defines template variables with their values.
Prepares the context to use in the template.
string | $name | the name of the template variable |
mixed | $value | the valueof the template variable |
Definition at line 125 of file view.class.php.
view::render | ( | ) |
Generates the html output of the templates parsing all the template variables. Adds the asset calls if present.
Definition at line 134 of file view.class.php.
view::setAssets | ( | $ | assets | ) |
Setter method for the $_asset property.
mixed | $assets | array in the form array('asset_path'=>'asset_type'). The 'asset_type' may be 'css' or 'js'. |
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.
string | $tpl | the template name |
array | $opts | an associative array of options
|
Definition at line 92 of file view.class.php.
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.
view::$_dft_css_folder [protected] |
the path to the folder containing the css of the default theme (fallback purposes)
Definition at line 61 of file view.class.php.
view::$_dft_view_folder [protected] |
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.