mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Update ControllerTask.php
Added an output message if no controllers are baked using the all() function.
This commit is contained in:
parent
caf350c01f
commit
d41bb0b1b3
1 changed files with 6 additions and 0 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue