Jeff PHP framework
0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
|
Framework router class. More...
Public Member Functions | |
__construct ($base_path) | |
Constructs a router instance. | |
getModule ($route) | |
Sets the module and method properties. | |
linkAjax ($module, $method, $params=array()) | |
Ajax link generation. | |
linkHref ($module, $method, $params=array(), $opts=null) | |
Link generation. | |
loader ($route) | |
Loads a module controller and returns its called method. | |
method () | |
Returns the method called by url. | |
module () | |
Returns the module called by url. | |
Private Attributes | |
$_base_path | |
base path for link generation | |
$_method | |
method called by url | |
$_module | |
module called by url | |
$_registry | |
the registry singleton instance |
Framework router class.
This class is used to load/call class methods, it includes the proper class file, instantiates the module's controller and call its method. Also it exports the url module and method to use for example in the template factory.
Definition at line 25 of file router.class.php.
router::__construct | ( | $ | base_path | ) |
Constructs a router instance.
string | $base_path | the base path |
Definition at line 53 of file router.class.php.
router::getModule | ( | $ | route | ) |
Sets the module and method properties.
array | $route | the class and method to set. Possible values are:
|
Definition at line 131 of file router.class.php.
router::linkAjax | ( | $ | module, |
$ | method, | ||
$ | params = array() |
||
) |
Ajax link generation.
This method is used to generate links which points directly to a controller class method, without considering the whole document (themes, templates and so on). Generally used to perform ajax requests.
string | $module | module name (the name of the model class) |
string | $method | method name |
array | $params | associative array of parameters in the form array('param_name'=>'param_value') |
Definition at line 187 of file router.class.php.
router::linkHref | ( | $ | module, |
$ | method, | ||
$ | params = array() , |
||
$ | opts = null |
||
) |
Link generation.
This method is used to generate links starting from a module name, one of its methods and additional parameters
string | $module | module name (the name of the model class) |
string | $method | method name |
array | $params | associative array of parameters in the form array('param_name'=>'param_value') |
mixed | $opts | associative array of oprions:
|
Definition at line 158 of file router.class.php.
router::loader | ( | $ | route | ) |
Loads a module controller and returns its called method.
array | $route | the class and method to call. Possible values are:
|
Definition at line 93 of file router.class.php.
router::method | ( | ) |
Returns the method called by url.
Definition at line 76 of file router.class.php.
router::module | ( | ) |
Returns the module called by url.
Definition at line 65 of file router.class.php.
router::$_base_path [private] |
base path for link generation
Definition at line 35 of file router.class.php.
router::$_method [private] |
method called by url
Definition at line 45 of file router.class.php.
router::$_module [private] |
module called by url
Definition at line 40 of file router.class.php.
router::$_registry [private] |
the registry singleton instance
Definition at line 30 of file router.class.php.