Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Custom path for layout

Hello everyone. Please tell me how to set the different path for the layout. Now if you specify setViewsDir, layout will be search layout in a subfolder "layouts". I want to ask for an independent path layout, not depending on the location of the folder views.

//Sorry for Google Translate :)

$this->view->setLayoutsDir("/layouts");

http://docs.phalconphp.com/en/latest/api/Phalcon_Mvc_View.html

This is not work for me, path will be "view/layouts", when i set path for the view directory - $this->view->setViewsDir('views'), Phalcon automatic search layout in subfolder "layouts"



1.5k
Accepted
answer

layouts is relative from the base view.

You can always do "../../../where your thing is/"

layouts is relative from the base view.

You can always do "../../../where your thing is/"

Thanks, I think have more right solution