damn...
Thanks for this information!
This should be documented. Knowing this, the current documentation of pick() is very incomplete and partly wrong. ( i'll try to contribute next Weekend )
another note:
using
$this->view->pick(foo/bar);
- changes views-dir to
./views/foo
- changes action-template to
bar
AND
- (to me, this is unintentional magic) changes the Controller-Layout to
foo
So after using the above pick(), \Phalcon\MVC\View will render ./views/foo/bar.phtml
into ./views/layouts/foo.phtml
(... into ./views/index.phtml
)
This is weird, i think.
IMHO: To make it more intuitive, there should be one method for each level (i.e.: setMainLayout('path/file'), setLayout('path/file'), setTemplate('path/file')) and/or one method for all (i.e.: ->pick('path/template','path/layout','path/mainlayout'))