You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP Fatal error: Uncaught exception 'Phalcon\DI\Exception' with message 'Service 'view' wasn't found in the dependency injection container' in index.php:15
Stack trace:
Though if you replace {% extends "layouts/main.html" %} with {% extends "views/layouts/main.html" %} in views/index/index.html Everything renders properly.
It also works if you add view to di $di->set('view', $view); with original templates but it does not feel right in this case. As I would expect view would register itself on setDi() call.
The text was updated successfully, but these errors were encountered:
I do know how to set code up to make it work. My concerns are more with architecture
I have 2 concerns in current situation:
View depends on Engine, Engine depends on View. It looks like a circular dependency. And does not sound like a good idea.
Even if first part is not an issue, view should act same no matter how extend paths are specified. But it only tries to access view only if path relative to view root is specified.
So as a solution I was suggesting to register view automatically on setDi in dependency container. Now when I think of it, better solution might be to pass view root folder on Phalcon\Mvc\View->_engineRender() call
Tried in version 0.7.0
Happens when Volt used separately from application
Setup:
index.php
views/index/index.html
views/index/index.html
Would throw:
Though if you replace
{% extends "layouts/main.html" %}
with{% extends "views/layouts/main.html" %}
inviews/index/index.html
Everything renders properly.It also works if you add view to di
$di->set('view', $view);
with original templates but it does not feel right in this case. As I would expect view would register itself onsetDi()
call.The text was updated successfully, but these errors were encountered: