diff --git a/lib/Cake/Console/Command/Task/ControllerTask.php b/lib/Cake/Console/Command/Task/ControllerTask.php index e788e3b7f..1a8f89558 100644 --- a/lib/Cake/Console/Command/Task/ControllerTask.php +++ b/lib/Cake/Console/Command/Task/ControllerTask.php @@ -110,6 +110,7 @@ class ControllerTask extends BakeTask { $admin = $this->Project->getPrefix(); } + $controllersCreated = 0; foreach ($this->__tables as $table) { $model = $this->_modelName($table); $controller = $this->_controllerName($model); @@ -123,8 +124,13 @@ class ControllerTask extends BakeTask { if ($this->bake($controller, $actions) && $unitTestExists) { $this->bakeTest($controller); } + $controllersCreated++; } } + + if ($controllersCreated === 0) { + $this->out(__d('cake_console', 'No Controllers were baked, Models need to exisit before Controllers can be baked.', $admin)); + } } /**