-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading helpers earlier in View's lifecycle allows for the removal of many duplicated code segments and a now useless property. It slightly modifies how View behaves in a test case, but that issue is easily remedied by calling loadHelpers() a second time. This primarily fixes issues where helpers may not be loaded in View subclasses if they override any of View's methods. This is particularly problematic when aliased helpers are involved. Refs #4030
- Loading branch information
Showing
4 changed files
with
5 additions
and
20 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
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
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
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
b8320fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How should we handle overidden helpers in helpers. For example, this change broke Croogo's test:
https://github.com/croogo/croogo/blob/master/Plugin/Croogo/Test/Case/View/Helper/CroogoFormHelperTest.php#L173
as it overrides
Html
helper implicitly, but then it reuses existing helper from the view.b8320fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing the view is loading the htmlhelper on construction. You could either remove the autoloading helpwer, or directly set the custom HTML helper into the collection. The second option is a bit shit though.