i have a layout used by all my views and i need to assign a variable from a controller to this layout , if i use this method on a controller it doesn\'t work :
p
There are three ways to achieve this in ZF2 (in your controller):
First:
$this->layout()->someVariableName = 'Some value for the variable';
Second:
$this->layout()->setVariable('someVariableName', 'Some value for the variable');
Third:
$this->layout()->setVariables(array(
'someVariableName' => 'Some value for the variable',
'anotherVariable' => 'Some value for another variable',
);