From bae8a9b43a71e80f02b64dfedb6b65776c1388dc Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 9 Jul 2012 21:48:19 -0400 Subject: [PATCH] Remove use of RouterException. * It was never really needed and just using the basic exception will work just fine. * Update the doc blocks for a few methods. --- lib/Cake/Routing/Router.php | 59 ++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php index a1118f484fb..4a72bdbd9f3 100644 --- a/lib/Cake/Routing/Router.php +++ b/lib/Cake/Routing/Router.php @@ -1,9 +1,5 @@ 'admin']); + * }}} + * + * Prefixes will create lower_case underscored resource routes. e.g + * `/admin/posts` * * ### Options: * @@ -354,7 +379,6 @@ public static function mapResources($controller, $options = array()) { 'id' => static::ID . '|' . static::UUID ), $options); - foreach ((array)$controller as $name) { list($plugin, $name) = pluginSplit($name); $urlName = Inflector::underscore($name); @@ -637,8 +661,6 @@ public static function url($url = null, $options = array()) { $hasLeadingSlash = isset($url[0]) ? $url[0] === '/' : false; } - // TODO refactor so there is less overhead - // incurred on each URL generated. $request = static::getRequest(true); if ($request) { $params = $request->params; @@ -754,9 +776,10 @@ public static function url($url = null, $options = array()) { * This will strip out 'autoRender', 'bare', 'requested', and 'return' param names as those * are used for CakePHP internals and should not normally be part of an output url. * - * @param Cake\Network\Request|array $params The params array or Cake\Network\Request object that needs to be reversed. - * @param boolean $full Set to true to include the full url including the protocol when reversing - * the url. + * @param Cake\Network\Request|array $params The params array or + * Cake\Network\Request object that needs to be reversed. + * @param boolean $full Set to true to include the full url including the + * protocol when reversing the url. * @return string The string that is the reversed result of the array */ public static function reverse($params, $full = false) {