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
It seems that when using multiple view directories ($view->setViewsDir(['dir1', 'dir2']), and a view with same name exists in both directories, both files get rendered.
I'm not sure if this is intended behavior, but it seem unintuitive to me in the case of a hierarchical view system where only the first found view should be rendered.
Solution seems to be to change the following line to the Zephir equivalent of "break 2;" instead of just a plain break.
The text was updated successfully, but these errors were encountered:
maurits150
changed the title
When using multiple directories in setViewsDir, views with same name are rendered multiple times.
When using multiple directories in setViewsDir, views with same name are rendered for each dir
Apr 6, 2016
maurits150
changed the title
When using multiple directories in setViewsDir, views with same name are rendered for each dir
[2.1 RC1] When using multiple directories in setViewsDir, views with same name are rendered for each dir
Apr 20, 2016
Didn't even knew that you can set array there actually, never used it like this, not sure, it might be a bug. If this change which OP proposed will fix it then great.
It seems that when using multiple view directories ($view->setViewsDir(['dir1', 'dir2']), and a view with same name exists in both directories, both files get rendered.
I'm not sure if this is intended behavior, but it seem unintuitive to me in the case of a hierarchical view system where only the first found view should be rendered.
Solution seems to be to change the following line to the Zephir equivalent of "break 2;" instead of just a plain break.
https://github.com/phalcon/cphalcon/blob/2.1.x/phalcon/mvc/view.zep#L714
This makes that not just the engines loop is terminated, but the view directories loop also.
The text was updated successfully, but these errors were encountered: