diff --git a/src/Console/Command/Task/BakeTask.php b/src/Console/Command/Task/BakeTask.php index 49f39de556d..9fa50e27f7f 100644 --- a/src/Console/Command/Task/BakeTask.php +++ b/src/Console/Command/Task/BakeTask.php @@ -177,10 +177,10 @@ public function getOptionParser() { 'short' => 'c', 'default' => 'default', 'help' => __d('cake_console', 'The datasource connection to get data from.') - ])->addOption('theme', [ + ])->addOption('template', [ 'short' => 't', 'default' => 'default', - 'help' => __d('cake_console', 'Theme to use when baking code.') + 'help' => __d('cake_console', 'Template to use when baking code.') ]); return $parser; } diff --git a/src/Console/Command/Task/ProjectTask.php b/src/Console/Command/Task/ProjectTask.php index 1aa29af8c17..a6c30fb6fd8 100644 --- a/src/Console/Command/Task/ProjectTask.php +++ b/src/Console/Command/Task/ProjectTask.php @@ -166,9 +166,9 @@ public function getOptionParser() { ])->addOption('empty', [ 'boolean' => true, 'help' => __d('cake_console', 'Create empty files in each of the directories. Good if you are using git') - ])->addOption('theme', [ + ])->addOption('template', [ 'short' => 't', - 'help' => __d('cake_console', 'Theme to use when baking code.') + 'help' => __d('cake_console', 'Template to use when baking code.') ])->addOption('composer', [ 'default' => ROOT . '/composer.phar', 'help' => __d('cake_console', 'The path to the composer executable.') diff --git a/src/Console/Command/Task/ViewTask.php b/src/Console/Command/Task/ViewTask.php index 497f8809145..7b6b853c162 100644 --- a/src/Console/Command/Task/ViewTask.php +++ b/src/Console/Command/Task/ViewTask.php @@ -380,19 +380,19 @@ public function getTemplate($action) { if (!empty($this->template) && $action != $this->template) { return $this->template; } - $themePath = $this->Template->getThemePath(); + $templatePath = $this->Template->getTemplatePath(); if (!empty($this->params['prefix'])) { $prefixed = Inflector::underscore($this->params['prefix']) . '_' . $action; - if (file_exists($themePath . 'views/' . $prefixed . '.ctp')) { + if (file_exists($templatePath . 'views/' . $prefixed . '.ctp')) { return $prefixed; } $generic = preg_replace('/(.*)(_add|_edit)$/', '\1_form', $prefixed); - if (file_exists($themePath . 'views/' . $generic . '.ctp')) { + if (file_exists($templatePath . 'views/' . $generic . '.ctp')) { return $generic; } } - if (file_exists($themePath . 'views/' . $action . '.ctp')) { + if (file_exists($templatePath . 'views/' . $action . '.ctp')) { return $action; } if (in_array($action, ['add', 'edit'])) { diff --git a/tests/TestCase/Console/Command/Task/ViewTaskTest.php b/tests/TestCase/Console/Command/Task/ViewTaskTest.php index e62f496f967..6e55c9456ac 100644 --- a/tests/TestCase/Console/Command/Task/ViewTaskTest.php +++ b/tests/TestCase/Console/Command/Task/ViewTaskTest.php @@ -94,7 +94,7 @@ class ViewTaskTest extends TestCase { /** * setUp method * - * Ensure that the default theme is used + * Ensure that the default template is used * * @return void */ @@ -124,7 +124,7 @@ protected function _setupTask($methods) { $this->Task->Template = new TemplateTask($io); $this->Task->Model = $this->getMock('Cake\Console\Command\Task\ModelTask', [], [$io]); - $this->Task->Template->params['theme'] = 'default'; + $this->Task->Template->params['template'] = 'default'; $this->Task->Template->templatePaths = ['default' => CAKE . 'Template/Bake/default/']; } @@ -709,7 +709,7 @@ public function testGetTemplatePrefixed() { $this->Task->Template->templatePaths = array( 'test' => CORE_TESTS . '/test_app/TestApp/Template/Bake/test/' ); - $this->Task->Template->params['theme'] = 'test'; + $this->Task->Template->params['template'] = 'test'; $result = $this->Task->getTemplate('edit'); $this->assertEquals('admin_edit', $result);