We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

[HELP] Rendering template from helper

Hey, what's up!

I have been trying to render a stand-alone template from my custom helper, here's my code:


(The code has been simplified)

No matter what path I set up for the view object, I always end up with an error message like this: *View '/path/to/view' was not found in any of the views directory

I've tried several things now, including using other methods for rendering (getRender, render, partial), setting up different view directories to the view object (Relative, absolute).

Question is: Is it possible to render a template from a helper? If so, how to do it?

Thanks in advance.

edited Mar '17

Yes it is, you just need to provide correct path. Post your structure, where is this listinghelper etc things. Also you should use getRender or something like this, partial is for other tasks.