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

how to set the main views directory?

I want to only change the main views directory,but I don't find the function like 'setMainDir'. how to set the main views directory?thanks.

edited Apr '15

sorry,I have just read the source code, found can't do that

edited Apr '15

you can set the main view, the default layout, layouts dir and partial dir

    $view->setPartialsDir( '/path/to/partials/');
    $view->setMainView('/path/to/default/view'); // notice the missing trailing slash

If absolute paths don't work, try relative ones. Absolute paths might not work when your path is outside the module.