-
-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Load Viewhelper by Namespace if old class name not exist
- Loading branch information
Markus Sommer
committed
Oct 30, 2015
1 parent
40d444f
commit 18a57e6
Showing
1 changed file
with
6 additions
and
0 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
Not that important as the ViewHelpers will most likely be loaded with autoloading now anyway but
the whole method is supposed to include ViewHelpers from paths in the viewHelperIncludePath which this bypasses as the include_once of those file is later which means that the class_exists check is to early if the ViewHelpers were not already loaded during autoloading. Also it would be good to "write" the class into the loadedHelperFiles array that way the next time the whole "find procedure" doesn't have to be done.
Also with this modification the loop itself for possible paths and extension keys is also irrelevant as if the found classname doesn't exist we always return the namespaced viewHelper.
I think the better solution would be to get the namespaced ViewHelper name before the loop as it is rather simple to get that name and check if that class exists, if it does return it, otherwise do the loop as it was.