Zend Framework 2 - Set Template Path for Module

寵の児 提交于 2020-01-16 13:17:24

问题


I googled alot and couldn't come up with an answer...

I'm using the tutorial-skeleton application. It automatically includes under 'view/album/album' the html files corresponding to my actions like add or index.

I'm using a submodule and the standard loading won't find my html-files. I followed this guide for setting a custom template path. This works for the index because here I use a ViewModel instance.

But my add/delete/edit actions just return an array like this one.

Is there a way to tell Zend that it should use a different directory to look for the views?

PS: I also tried this injectTemplate approach but no luck. It just sets the Controller namespace/path which is ok in my case.


回答1:


This was an project specific issue...

I used MasterData as top namespace. When creating the directory tree in my module\MasterData\view I wrote masterdata instead of master-data. This caused the not finding of my views.

A dumb one... I know.



来源:https://stackoverflow.com/questions/14052742/zend-framework-2-set-template-path-for-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!