Replacing request->here with request->here(). Saves a call to Router::normalize() in a few places.

This commit is contained in:
mark_story 2011-03-02 22:03:21 -05:00
parent a6abd61f3f
commit 5e3cd74b03
2 changed files with 5 additions and 5 deletions

View file

@ -172,7 +172,7 @@ class ExceptionRenderer {
* @return void * @return void
*/ */
protected function _cakeError(CakeException $error) { protected function _cakeError(CakeException $error) {
$url = Router::normalize($this->controller->request->here); $url = $this->controller->request->here();
$code = $error->getCode(); $code = $error->getCode();
$this->controller->response->statusCode($code); $this->controller->response->statusCode($code);
$this->controller->set(array( $this->controller->set(array(
@ -195,7 +195,7 @@ class ExceptionRenderer {
if (Configure::read('debug') == 0 && $error instanceof CakeException) { if (Configure::read('debug') == 0 && $error instanceof CakeException) {
$message = __('Not Found'); $message = __('Not Found');
} }
$url = Router::normalize($this->controller->request->here); $url = $this->controller->request->here();
$this->controller->response->statusCode($error->getCode()); $this->controller->response->statusCode($error->getCode());
$this->controller->set(array( $this->controller->set(array(
'name' => $message, 'name' => $message,
@ -211,7 +211,7 @@ class ExceptionRenderer {
* @param array $params Parameters for controller * @param array $params Parameters for controller
*/ */
public function error500($error) { public function error500($error) {
$url = Router::normalize($this->controller->request->here); $url = $this->controller->request->here();
$code = ($error->getCode() > 500) ? $error->getCode() : 500; $code = ($error->getCode() > 500) ? $error->getCode() : 500;
$this->controller->response->statusCode($code); $this->controller->response->statusCode($code);
$this->controller->set(array( $this->controller->set(array(

View file

@ -213,8 +213,8 @@ class CacheHelper extends AppHelper {
} else { } else {
$cacheTime = strtotime($timestamp, $now); $cacheTime = strtotime($timestamp, $now);
} }
$path = $this->request->here; $path = $this->request->here();
if ($this->here == '/') { if ($path == '/') {
$path = 'home'; $path = 'home';
} }
$cache = strtolower(Inflector::slug($path)); $cache = strtolower(Inflector::slug($path));