We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

HMVC question

Hi!!!

How to use the files from views??

The output is a function of the "echo" in action



42.1k

from the example on github

public function helloAction()
    {
        return new Response('hello there');
    }

whether you can use the view files???



98.9k

You can get the file and return it as part of the response:

public function helloAction()
{
    return new Response(file_get_contents('my-path/my-file.txt'));
}


42.1k

All the same, why not use the files in the folder views???