phalcon-devtools
phalcon-devtools copied to clipboard
Add ability to configure config, controllers, models, views directories generated in the module
Hello!
- Type: new feature
- Link to issue:
In raising this pull request, I confirm the following (please check boxes):
- [x] I have read and understood the Contributing Guidelines
- [x] I have checked that another pull request for this purpose does not exist
- [ ] I wrote some tests for this PR
Small description of change:
Phalcon is flexible so code generator should be too - i.e. I want PSR compatible Controllers, Views, Models instead of controllers, view, models and someone my name them i.e. Ctrl, View, Model.
Also optional routes addition file may be beneficial (if user place desired Routes.php in their templates dir).
I.e. I prefer to see all routes related to the feature (module) and who is intended to use them in one place rather than disseminated in docblocks.
class Routes extends \BaseRoutes
{
protected $_prefix = '/profile';
public function __construct(\Phalcon\Mvc\Router $router, $module)
{
parent::__construct($router, $module);
$this->get('')(['user']);
$this->get('/me', null, 'me')(['*']);
$this->post('/search', null, 'search')(['user']);
$this->post('/email', null, 'email')(['user']);
$this->post('/password', null, 'password')(['user']);
$this->post('/fullname', null, 'fullname')(['user']);
}
}
Thanks