I have following Action in one of my controllers:
public function validateMessageAction() {
$sth = new ViewModel($this->params('params'));
$adServerOutput = $this->forward()->dispatch('Adserver/Controller/Index', array('action' => 'index'));
$sth->addChild($adServerOutput, 'adServerOutput');
return $sth;
}
Next I have a following template:
adServerOutput: <?php echo $this->adServerOutput; ?><br><br>
Validate message link clicked<br>
Of course the Adserver/Controller/Index and corresponding template exists as well, can be called and once called - shows correct output (from its template).
Unfortunatelly what I get after going to validateMessage action is only the "Validate message link clicked" text - nothing that is setup in Adserver/Controller/Index->indexAction().
Any idea why that works this way ?
Additional information to that might be that actually the validateMessageAction()
is also triggered from different controller via $this->forward()->dispatch(...)
- maybe that might be the case ?
EDIT: I have checked that as well - and even if the forward()
call is only done once - still the problem persists...
I will really greatly appreciate any hints - sitting on this for 2 days already and have no clue even what to check further :)
EDIT: ADDITIONAL TESTS and information I have done some additional tests and found here are some additional info:
Now when I only try to call
$a = $this->forward()->dispatch(...)
even if $a is not assigned or anyhow used (only this association is performed) - the page immediatelly starts using Adserver layout (but still contents are not shown) - ignoring the layout that was specified for validateMessageAction() (of course when I remove that assotiation - the layout for validateMessageAction() is back immediatelly).
As I understood in the documentation forward should not make any action, but rather only result with string containing rendered module.
There can however be one additional information in here - is that I use EdpModuleLayouts - maybe that might be somehow source of the problem ?
(Posted on behalf of the OP).
Problem was caused by EdpModuleLayouts - removing layout for Adserver (which actually should not have a layout) solved the problem.