Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make extending a missing element throw an exception
A layout extending a missing layout throws a missing-layout exception A view extendinga missing view throws a missing-view exception Now, an element extending a missing element throws a logic exception in addition "absolute" paths can be used such that (using elements as an example) $this->extend('foo') - extends View/Elements/foo.ctp $this->extend('/foo') - extends View/foo.ctp Closes #2504
- Loading branch information
Showing
4 changed files
with
38 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
lib/Cake/Test/test_app/View/Elements/extended_missing_element.ctp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php $this->extend('noneexistent_parent_element'); ?> | ||
Element content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php echo $this->element('extended_missing_element'); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters