Ticket Details

Router::match('Foo::') to behave like Router::match('controller' => 'foo')

ENHANCEMENT Ticket (closed)

###What happened:
- I like the short syntax `Controller::action`
- but cannot use it for `index` because I don't like seeing `index` in my URL

{{{
// The way I like to generate URL
$this->url('Foo::bar') -> /foo/bar
// The ones I cannot generate using this syntax
$this->url('Foo::index') -> /foo/index
// instead I have to do this
$this->url('controller' => 'foo') -> /foo
}}}

###What was expected

{{{
// Assuming
$this->url('Foo::index') -> /foo/index
// is similar to
$this->url('controller' => 'foo', 'action' => 'index') -> /foo/index

// This could do the trick
$this->url('Foo::') -> /foo
}}}

####Patch

Commit: [ cf0f1cde05538ec3dab3f39a06eed99e53450942](http://rad-dev.org/forks/greut/lithium/commits/view/cf0f1cde05538ec3dab3f39a06eed99e53450942)
on 06.01.11 reported by: greut owned by: nate

Updates

on 06.01.11 by greut
  • description was changed
(works-for-me) on 06.01.11 by nate
  • owner was changed to nate
  • status was changed to closed
  • resolution was changed to works-for-me
http://dev.lithify.me/lithium/source/libraries/lithium/tests/cases/net/http/RouterTest.php#150
(reopened) on 06.01.11 by greut
  • status was changed to pending
  • resolution was removed
Actually the problem is that my routes are like that.

{{{
$options = array('persist' => array('locale', 'controller'));
Router::connect('/{:locale:[a-z][a-z]}/{:controller}/{:action}/{:args}', array(), $options);

Router::match('Foo::index', $request); // -> /fr/foo/index
}}}

Not persisting the `locale` works:

{{{
$options = array('persist' => array('controller'));
Router::connect('/{:locale:[a-z][a-z]}/{:controller}/{:action}/{:args}', array(), $options);

Router::match('Foo::index', $request); // -> /foo
}}}
(works-for-me) on 06.01.11 by nate
  • status was changed to closed
  • resolution was changed to works-for-me
:-)