[ Index ] |
|
Code source de PHPonTrax 2.6.6-svn |
[Code source] [Imprimer] [Statistiques]
File containing the Router class (PHP 5)
Copyright: | (c) 2005 John Peterson |
Version: | $Id: router.php 174 2006-03-14 04:10:15Z haas $ |
Poids: | 197 lignes (7 kb) |
Inclus ou requis: | 1 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
Router:: (4 méthodes):
get_selected_route()
connect()
find_route()
build_route_regexp()
get_selected_route() X-Ref |
Accessor method to return contents of $selected_route return: string[] Contents of $selected_route |
connect($path, $params = null) X-Ref |
Accessor method to add a route to the route table The route is added to the end of {@link $routes the route table}. If $params is not an array, NULL is stored in the route parameter area. param: string $path param: mixed[] $params |
find_route($url) X-Ref |
Find first route in route table with path that matches argument First, assure that the route table {@link $routes} has at least one route by adding {@link $default_route_path the default route} if the table is empty. Then search the table to find the first route in the table whose path matches the argument $url. If $url is an empty string, it matches a path that is an empty string. Otherwise, try to match $url to the path part of the table entry according to {@link http://www.php.net/manual/en/ref.pcre.php Perl regular expression} rules. If a matching route is found, return it any to the caller, and also save a copy in {@link $selected_route}; if no matching route is found return null. param: string $url return: mixed Matching route or null. Path is in return['path'], |
build_route_regexp($route_path) X-Ref |
Build a regular expression that matches a route param: string $route_path A route path. return: string Regular expression that matches the route in |
Généré le : Sun Feb 25 20:04:38 2007 | par Balluche grâce à PHPXref 0.7 |