cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[NFR]Phalcon\Mvc\Router get defaults

Open nexik opened this issue 12 years ago • 4 comments

There are many nice methods like:

setDefaultNamespace
setDefaultModule
setDefaultController
setDefaultAction

It would be nice to have getDefault* methods

I can try to write PR but first I want get feedback if this methods would be helpful for others. The problem is that they are needed only for writing unit tests to my custom routing class.

Currently I wrote them in php in custom routing class and use routing protected properties (for example $this->_defaultNamespace)

nexik avatar Feb 25 '14 22:02 nexik

Have been implemented, you cant test it.

//Setting a specific default
$router->setDefaultModule('backend');
$router->setDefaultNamespace('Backend\Controllers');
$router->setDefaultController('index');
$router->setDefaultAction('index');

dreamsxin avatar Feb 25 '14 23:02 dreamsxin

I know about set methods but I want to write this:

$router->setDefaultModule('backend')l
assertEquals('backend', $router->getDefaultModule())

nexik avatar Feb 26 '14 16:02 nexik

Hi, In 1.3.0 get* is Implemented.

dreamsxin avatar Feb 26 '14 19:02 dreamsxin

Oh. I miss that. Thanks for the information.

nexik avatar Feb 26 '14 19:02 nexik