Update ControllerTask.php

Added an output message if no controllers are baked using the all() function.
This commit is contained in:
pummra 2014-01-08 09:52:05 +00:00
parent caf350c01f
commit d41bb0b1b3

View file

@ -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));
}
}
/**