mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
throw an exception if the view you try to extend doesn't exist
or element, or layout
This commit is contained in:
parent
4f1be12046
commit
def96c0460
1 changed files with 4 additions and 0 deletions
|
@ -679,6 +679,10 @@ class View extends Object {
|
|||
break;
|
||||
|
||||
}
|
||||
|
||||
if (!$parent) {
|
||||
throw new LogicException(__d('cake_dev', 'The parent %s you specified doesn\'t exist.', $this->_currentType));
|
||||
}
|
||||
if ($parent == $this->_current) {
|
||||
throw new LogicException(__d('cake_dev', 'You cannot have views extend themselves.'));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue