Skip to content

Commit

Permalink
Merge pull request #502 from sergeyklay/2.0.x
Browse files Browse the repository at this point in the history
Fixed isse #184
  • Loading branch information
sergeyklay committed Sep 15, 2015
2 parents c20ef67 + 66fa3d3 commit 2fc2bac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion scripts/Phalcon/Builder/Project/Modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,15 @@ class Modules extends ProjectBuilder
*/
private function createControllerFile()
{
$namespace = $this->options->get('name');
if (strtolower(trim($namespace)) == 'default') {
$namespace = 'MyDefault';
}

$builder = new ControllerBuilder(array(
'name' => 'index',
'controllersDir' => $this->options->get('projectPath') . 'apps/frontend/controllers/',
'namespace' => ucfirst($this->options->get('name')) . '\Frontend\Controllers',
'namespace' => ucfirst($namespace) . '\Frontend\Controllers',
'baseClass' => 'ControllerBase'
));

Expand Down
7 changes: 6 additions & 1 deletion scripts/Phalcon/Builder/Project/ProjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,13 @@ protected function generateFile($getFile, $putFile, $name = '')

$str = file_get_contents($getFile);
if ($name) {
$namespace = $name;
if (strtolower(trim($name)) == 'default') {
$namespace = 'MyDefault';
}

$str = preg_replace('/@@name@@/', $name, $str);
$str = preg_replace('/@@namespace@@/', ucfirst($name), $str);
$str = preg_replace('/@@namespace@@/', $namespace, $str);
}

if (sizeof($this->variableValues) > 0) {
Expand Down

0 comments on commit 2fc2bac

Please sign in to comment.