Skip to content
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

Duplicate partials rendering #13041

Closed
davihu opened this issue Aug 27, 2017 · 1 comment
Closed

Duplicate partials rendering #13041

davihu opened this issue Aug 27, 2017 · 1 comment
Labels
duplicate Duplicate issue. The duplicate issue is referenced in the comments

Comments

@davihu
Copy link

davihu commented Aug 27, 2017

Hello,

I am using multiple viewsDirs and I need to confirm, that actual template targeting and rendering system in Phalcon works as intended.

I have 2 view dirs:

  1. .../skins/my_skin/views/
  2. .../frontend/views/

I would expect, as in other frameworks, that if I have template block/footer.volt under both directories, it will check for first existing template under views dirs and render it.

But current implementation in Phalcon works much different, it checks every time all directories and renders all templates found. So the most priority template is the last one and not the first one.

This is causing some performance overhead and it is causing problem when you want to render some partial, because it is rendered multiple times.

This for loop is causing the unexpected behavior

https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/view.zep#L665

Is this functionality intended? If not, then it is a major bug.

Replacing

https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/view.zep#L689

break for return null solves the problem.

@Jurigag
Copy link
Contributor

Jurigag commented Aug 28, 2017

Duplicate of #12977

@sergeyklay sergeyklay added the duplicate Duplicate issue. The duplicate issue is referenced in the comments label Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Duplicate issue. The duplicate issue is referenced in the comments
Projects
None yet
Development

No branches or pull requests

3 participants