From 607178847850d66cfeddd668dca37423185bf31a Mon Sep 17 00:00:00 2001 From: Miah Gregory Date: Tue, 18 Jan 2011 14:23:12 -0800 Subject: [PATCH] Updated documentation for Router::connect. Fixed a few spelling issues as well. Signed-off-by: mark_story --- cake/libs/router.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index cd4c27999..622dae829 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -161,7 +161,7 @@ class Router { } /** - * Sets the Routing prefixes. Includes compatibilty for existing Routing.admin + * Sets the Routing prefixes. Includes compatibility for existing Routing.admin * configurations. * * @return void @@ -236,21 +236,25 @@ class Router { * Shows connecting a route with custom route parameters as well as providing patterns for those parameters. * Patterns for routing parameters do not need capturing groups, as one will be added for each route params. * - * $options offers two 'special' keys. `pass` and `persist` have special meaning in the $options array. + * $options offers three 'special' keys. `pass`, `persist` and `routeClass` have special meaning in the $options array. * * `pass` is used to define which of the routed parameters should be shifted into the pass array. Adding a * parameter to pass will remove it from the regular route array. Ex. `'pass' => array('slug')` * * `persist` is used to define which route parameters should be automatically included when generating - * new urls. You can override peristent parameters by redifining them in a url or remove them by + * new urls. You can override persistent parameters by redefining them in a url or remove them by * setting the parameter to `false`. Ex. `'persist' => array('lang')` * + * `routeClass` is used to extend and change how individual routes parse requests and handle reverse routing, + * via a custom routing class. Ex. `'routeClass' => 'SlugRoute'` + * * @param string $route A string describing the template of the route * @param array $defaults An array describing the default route parameters. These parameters will be used by default * and can supply routing parameters that are not dynamic. See above. * @param array $options An array matching the named elements in the route to regular expressions which that * element should match. Also contains additional parameters such as which routed parameters should be - * shifted into the passed arguments. As well as supplying patterns for routing parameters. + * shifted into the passed arguments, supplying patterns for routing parameters and supplying the name of a + * custom routing class. * @see routes * @return array Array of routes * @access public @@ -708,7 +712,7 @@ class Router { * * @param $which A zero-based array index representing the route to move. For example, * if 3 routes have been added, the last route would be 2. - * @return boolean Retuns false if no route exists at the position specified by $which. + * @return boolean Returns false if no route exists at the position specified by $which. * @access public * @static */ @@ -732,7 +736,7 @@ class Router { * Returns an URL pointing to a combination of controller and action. Param * $url can be: * - * - Empty - the method will find address to actuall controller/action. + * - Empty - the method will find address to actual controller/action. * - '/' - the method will find base URL of application. * - A combination of controller/action - the method will find url for it. * @@ -1044,7 +1048,7 @@ class Router { } /** - * Reverses a parsed parameter array into a string. Works similarily to Router::url(), but + * Reverses a parsed parameter array into a string. Works similarly to Router::url(), but * Since parsed URL's contain additional 'pass' and 'named' as well as 'url.url' keys. * Those keys need to be specially handled in order to reverse a params array into a string url. * @@ -1177,7 +1181,7 @@ class Router { } /** - * Takes an passed params and converts it to args + * Takes a passed params and converts it to args * * @param array $params * @return array Array containing passed and named parameters @@ -1393,7 +1397,7 @@ class CakeRoute { /** * Checks to see if the given URL can be parsed by this route. - * If the route can be parsed an array of parameters will be returned if not + * If the route can be parsed an array of parameters will be returned; if not, * false will be returned. String urls are parsed if they match a routes regular expression. * * @param string $url The url to attempt to parse. @@ -1470,8 +1474,8 @@ class CakeRoute { } /** - * Attempt to match a url array. If the url matches the route parameters + settings, then - * return a generated string url. If the url doesn't match the route parameters false will be returned. + * Attempt to match a url array. If the url matches the route parameters and settings, then + * return a generated string url. If the url doesn't match the route parameters, false will be returned. * This method handles the reverse routing or conversion of url arrays into string urls. * * @param array $url An array of parameters to check matching with.