Skip to content

Commit

Permalink
Fixing the NS that is generated in the templates. The convention is t…
Browse files Browse the repository at this point in the history
…o use / for plugin NS but this conflicts with phps \ for the php NS.
  • Loading branch information
Florian Krämer committed Nov 1, 2014
1 parent b4b7f6f commit 3895f56
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Shell/Task/ControllerTask.php
Expand Up @@ -158,6 +158,7 @@ public function bakeController($controllerName, array $data) {
'plugin' => null,
'pluginPath' => null,
];
$data['namespace'] = str_replace('/', '\\', $data['namespace']);
$this->Template->set($data);

$contents = $this->Template->generate('classes', 'controller');
Expand Down
2 changes: 1 addition & 1 deletion src/Shell/Task/ModelTask.php
Expand Up @@ -621,7 +621,7 @@ public function bakeTable($model, array $data = []) {
$ns = Configure::read('App.namespace');
$pluginPath = '';
if ($this->plugin) {
$ns = $this->plugin;
$ns = str_replace('/', '\\', $this->plugin);
$pluginPath = $this->plugin . '.';
}

Expand Down
1 change: 1 addition & 0 deletions src/Shell/Task/TestTask.php
Expand Up @@ -195,6 +195,7 @@ public function bake($type, $className) {

$this->out("\n" . sprintf('Baking test case for %s ...', $fullClassName), 1, Shell::QUIET);

$namespace = str_replace('/', '\\', $namespace);
$this->Template->set('fixtures', $this->_fixtures);
$this->Template->set('plugin', $this->plugin);
$this->Template->set(compact(
Expand Down

0 comments on commit 3895f56

Please sign in to comment.