Zend Framework: redirecting from a controller plugin that is more efficient

I saw from here 2 ways to redirect from the controller plugin ... I wonder which one is more efficient. I am interested in the second method, perhaps slower, because the answer is being created? what happens in the first method? will it redirect immediately?

$request->setModuleName('default')
        ->setControllerName('search')
        ->setActionName('form')
        ->setDispatched(false);

or

$this->_response->setRedirect('redirecturl'); 
+3
source share
1 answer

The first method is to redirect the application: you determine that the requested operation is located within another controller, so the same HTTP request is used to perform the action.

- http: http-response http-, HTTP-, .

, , .

PS: forward-controller .

+5

Source: https://habr.com/ru/post/1757648/


All Articles