Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated documentation for Router::connect.

Fixed a few spelling issues as well.

Signed-off-by: mark_story <mark@mark-story.com>
  • Loading branch information...
commit 607178847850d66cfeddd668dca37423185bf31a 1 parent d4e4957
@dsl dsl authored markstory committed
Showing with 15 additions and 11 deletions.
  1. +15 −11 cake/libs/router.php
View
26 cake/libs/router.php
@@ -161,7 +161,7 @@ function 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 @@ function getNamedExpressions() {
* 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 @@ function reload() {
*
* @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 @@ function promote($which = null) {
* 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 @@ function queryString($q, $extra = array(), $escape = false) {
}
/**
- * 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 @@ function parseExtensions() {
}
/**
- * 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 @@ function _writeRoute() {
/**
* 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 @@ function persistParams($url, $params) {
}
/**
- * 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.
Please sign in to comment.
Something went wrong with that request. Please try again.