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

phalcon 3 view->pick change from phalcon 2 ajax call

Hi

picking view in phalcon 3 doen't work same as phalcon 2..!!! when I switch mamp from PHP 7.08 and Phalcon 3.01 to PHP 5.6.10 and Phalcon 2.013 it works properly my code doesn't work properly on phalcon 3 and php 7 as it used to..?!?

    public function editAction()
    {
        if ($this->request->isAjax()) {
        /// operation
        }
        $this->view->pick("path/to/customview");
    }

my aim is showing and picking custom view on ajax call to update part of current page which used to work.

I have already tried $this->view->setRenderLevel and $this->view->disable() and also $this->view->disableLevel

it s funny cuz I am getting error Error: Class MyNameSpace\Controllers\View not found...



85.5k

try with return $this->view->pick ?



8.4k

still not working on phalcon 3 php 7

try with return $this->view->pick ?



8.1k

You can render by Volt your partial view and send it inresponse as JSON structure like

{
     mywidget : "<tt>mydata<tt>" 
}

Then change your DOM adding this data like



8.4k

no.. not working.. btw I am not using volt, it is custom html,...

You can render by Volt your partial view and send it inresponse as JSON structure like

{
    mywidget : "<tt>mydata<tt>" 
}

Then change your DOM adding this data like



8.4k

@phalcon phalcon 3.0.1 in php 7.0.8 implemented different reaction on $this->view->pick by loading main layout, action views also I ve got no edit.phtml while I ve got prefect working same code on phalcon 2.0.13 and php 5.6.10. is it a bug or change !? what should I do to get same result?



8.1k

no.. not working.. btw I am not using volt, it is custom html,...

You can render by Volt your partial view and send it inresponse as JSON structure like

{
    mywidget : "<tt>mydata<tt>" 
}

Then change your DOM adding this data like

All works. Remember set JSON content of Response



43.9k

Error: Class MyNameSpace\Controllers\View not found...

strange indeed