Simple question, but can’t figure it out.
Why when calling $this->partial() in a view in Zend Framework 2 inside a view in the Admin module, it looks for the file in Application module??
Here’s a stack:
include( '/.../module/Admin/view/admin/pages/index.phtml' )
include( '/.../module/Application/view/partials/pagination.phtml' )
I don’t really understand what this include stuff is that you do…
You have two ways to assign templates for partials. I always suggest going the fully qualified way, as this is the fastest way possible, too.
When you only use
ACTIONNAMEinstead of the fully qualified template name, then the renderer will look inside your current module and sarch foractionname.phtmlin said module.You have to use the fully qualified template name in order to load partials from another module.
As mentioned previously though, ALWAYS go fully qualified. It’s a lot faster 😉