Hi, I need to do forward to another action in the same controller but after forwarding initialize constructor doesn`t execute:
class ProfileController extends ControllerBase
{
public function initialize(){
parent::initialize();
$this->logger->alert('I`m Index Initaialize');
}
public function indexAction(){
$this->logger->alert('I`m Index Action');
}
public function testAction(){
$this->logger->alert('I`m Test Action');
}
}
Then, I go to testAction (https://localhost/profile/test) and in logs I have the following output:
[Sun, 12 Oct 14 15:10:54 +0400][ALERT] I`m Index Initaialize
[Sun, 12 Oct 14 15:10:54 +0400][ALERT] I`m Test Action
[Sun, 12 Oct 14 15:10:54 +0400][ALERT] I`m Index Action
So, we can see, than initialize constructor didn't execute second time (after forwarding to the same controller), but I need initialize constructor for every action, e.g. I set template before for view in initialize constructor and It doesn't work after forwarding.
Thanks for your help.