mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 03:22:39 +00:00
Fixing issue where ViewTask would make empty view files for actions that did not have templates. Test case added. Fixes #1040
This commit is contained in:
parent
ece055eefe
commit
c48c0d6295
2 changed files with 16 additions and 0 deletions
|
@ -366,6 +366,9 @@ class ViewTask extends BakeTask {
|
|||
if ($content === true) {
|
||||
$content = $this->getContent($action);
|
||||
}
|
||||
if (empty($content)) {
|
||||
return false;
|
||||
}
|
||||
$path = $this->getPath();
|
||||
$filename = $path . $this->controllerPath . DS . Inflector::underscore($action) . '.ctp';
|
||||
return $this->createFile($filename, $content);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue