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

Can't change default render view

Hi, Actually i use this method in a controller to show a different view than the initial view of the action.

class IndexController extends BaseController {
    public function indexAction() {
        $this->view->pick("products/category");
    }
}

But when i do that, the render view is views/products/category.phtml, but the code in /views/index.phtml is executed but not rendered. (I discover that the query in index.phtml are executed in the log file)

Same problem in Phalcon 1.3.1 and 1.3.2

Why is the defaut views executed, and how can i avoid that ?

You have to use:

$this->view->pick("product/category");

Instead of:

$this->view->pick("products/category");


7.9k

I make a mistake in the description of my post.

Is it a bug if default view is executed (but not render) when using pick ?