cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Cannot use View pick and setLayout at same time

Open netblue opened this issue 13 years ago • 4 comments

Within the same action, I cannot use setLayout and pick together. When using both at the same time, only the pick function works. If I comment out the call to pick, then setLayout works properly.

public function indexAction()
{
            $this->view->setLayout('twocolumn');
            $this->view->pick("index/hello");
}

netblue avatar Jan 26 '13 07:01 netblue

Sorry but this is not a bug, this is the intended behavior

ghost avatar Jan 28 '13 09:01 ghost

If I understand the layouts correctly, Phalcon has a main template, a controller level template, and an action level template. Three separate entities which each have a function to change default behavior of which template is used for rendering at each of these levels. (setMainView, setLayout, and pick) From a design perspective, it doesn't make sense to be able to call setLayout with a custom controller level template, and then call pick for a custom action level template would set the custom controller template back to default. They should be completely independent of each other.

netblue avatar Jan 28 '13 21:01 netblue

How about this being a new feature request if not a bug?

netblue avatar Feb 22 '13 06:02 netblue

@netblue Can you please close this issue and create a new one [NFR] explaining a bit about the new functionality and if need be referencing this issue?

I am not sure when this will be done, since we have a lot of other requests but we can definitely check it out and put it in the roadmap.

Thanks!

niden avatar Feb 22 '13 16:02 niden