-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add View::exists() and View::getRegisteredEngines() #1707
Comments
+1 getRegisteredEngines() would be also helpful when one can unit test View configuration setted in DI. Without it I can't check if view has Volt engine configured in Dependency Injection. |
public function getRegisteredEngines()
{
return $this->_registeredEngines;
} and no need to override |
Implemented in 1.3.0, could you please take a look? |
@sjinks, thanks for the quick turn around, this works great. |
@sjinks, makes sense adding this to the ViewInterface as well. What do you think? |
I have been extending the Phalcon framework lately with my own bits and pieces and ran into a minor niggle with the
View
class. I have added my own cascading behavior to views so that if a view doesn't exist, then I look for a view one folder higher (and some other stuff).There is no function
View::exists
so I have had to define it as:This of course depends on a function called
getRegisteredEngines()
defined as:which in turn depends on
$this->_enginesInfo
populated by overriding theregisterEngines
method:I think it would be beneficial to people who wish to extend the core framework with custom functionality since the current View implementation is a leaky abstraction (no way to enumerate a list of registered engines for example).
The text was updated successfully, but these errors were encountered: