Skip to content

Commit

Permalink
Convert from :: to :
Browse files Browse the repository at this point in the history
Its a bit shorter and shorter is better.
  • Loading branch information
markstory committed Jul 4, 2012
1 parent 84d57e2 commit f977d71
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Routing/Route/Route.php
Expand Up @@ -184,7 +184,7 @@ protected function _writeRoute() {
}

/**
* Get the standardized plugin.controller::action name
* Get the standardized plugin.controller:action name
* for a route. This will compile a route if it has not
* already been compiled.
*
Expand All @@ -200,7 +200,7 @@ public function getName() {
}
foreach (array('controller', 'action') as $key) {
if ($key === 'action') {
$name .= '::';
$name .= ':';
}
if (isset($this->defaults[$key])) {
$name .= strtolower($this->defaults[$key]);
Expand Down
10 changes: 5 additions & 5 deletions lib/Cake/Routing/RouteCollection.php
Expand Up @@ -100,15 +100,15 @@ protected function _getNames($url) {
$plugin = $url['plugin'];
}
$fallbacks = array(
'%2$s::%3$s',
'%2$s::_action',
'%2$s:%3$s',
'%2$s:_action',
'_controller::_action'
);
if ($plugin) {
$fallbacks = array(
'%1$s.%2$s::%3$s',
'%1$s.%2$s::_action',
'_controller::_action'
'%1$s.%2$s:%3$s',
'%1$s.%2$s:_action',
'_controller:_action'
);
}
foreach ($fallbacks as $i => $template) {
Expand Down
12 changes: 6 additions & 6 deletions lib/Cake/Test/TestCase/Routing/Route/RouteTest.php
Expand Up @@ -619,13 +619,13 @@ public function testGetName() {
$this->assertEquals('testing', $route->getName());

$route = new Route('/:controller/:action');
$this->assertEquals('_controller::_action', $route->getName());
$this->assertEquals('_controller:_action', $route->getName());

$route = new Route('/articles/:action', array('controller' => 'posts'));
$this->assertEquals('posts::_action', $route->getName());
$this->assertEquals('posts:_action', $route->getName());

$route = new Route('/articles/list', array('controller' => 'posts', 'action' => 'index'));
$this->assertEquals('posts::index', $route->getName());
$this->assertEquals('posts:index', $route->getName());
}

/**
Expand All @@ -638,19 +638,19 @@ public function testGetNamePlugins() {
'/a/:controller/:action',
array('plugin' => 'asset')
);
$this->assertEquals('asset._controller::_action', $route->getName());
$this->assertEquals('asset._controller:_action', $route->getName());

$route = new Route(
'/a/assets/:action',
array('plugin' => 'asset', 'controller' => 'assets')
);
$this->assertEquals('asset.assets::_action', $route->getName());
$this->assertEquals('asset.assets:_action', $route->getName());

$route = new Route(
'/assets/get',
array('plugin' => 'asset', 'controller' => 'assets', 'action' => 'get')
);
$this->assertEquals('asset.assets::get', $route->getName());
$this->assertEquals('asset.assets:get', $route->getName());
}

}

0 comments on commit f977d71

Please sign in to comment.