Skip to content
Permalink
Browse files

Make getting the name of a route not require compiling it.

  • Loading branch information...
markstory committed Apr 15, 2012
1 parent 6defae0 commit 6f8bd5a3482cd0f463541901ee7660fd93586352
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/Cake/Routing/Route/Route.php
@@ -194,9 +194,6 @@ public function getName() {
if (!empty($this->_name)) {
return $this->_name;
}
if (!$this->compiled()) {
$this->compile();
}
$name = '';
if (isset($this->defaults['plugin'])) {
$name .= strtolower($this->defaults['plugin']) . '.';
@@ -206,7 +203,8 @@ public function getName() {
if (isset($this->defaults[$key])) {
$parts[] = $this->defaults[$key];
}
if (in_array($key, $this->keys, true)) {
$var = ':' . $key;
if (strpos($this->template, $var) !== false) {
$parts[] = '_' . $key;
}
}

0 comments on commit 6f8bd5a

Please sign in to comment.
You can’t perform that action at this time.