mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-12 06:56:24 +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;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$parent) {
|
||||||
|
throw new LogicException(__d('cake_dev', 'The parent %s you specified doesn\'t exist.', $this->_currentType));
|
||||||
|
}
|
||||||
if ($parent == $this->_current) {
|
if ($parent == $this->_current) {
|
||||||
throw new LogicException(__d('cake_dev', 'You cannot have views extend themselves.'));
|
throw new LogicException(__d('cake_dev', 'You cannot have views extend themselves.'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue