Your code syntax is wrong,
$list = array(
$this->Html->image('cloud.png', array('alt' => 'logo image')) =>
array(
$this->Html->image('heart.png', array('alt' => 'logo image')) =>
array(
$this->Html->image('email.png', array('alt' => 'logo image')),
$this->Html->image('profile.png', array('alt' => 'logo image')),
$this->Html->image('logo.png', array('alt' => 'logo image'))
)
)
);
You cannot use echo inside the array.
Alternatively you can create your own helper and method, as mentioned below:
send only image name array to the helper and in return get name and alt tags in desired order then loop them as shown below:
$list = array('cloud.png','heart.png','email.png','profile.png','logo.png');
$arragedList = $this->MyHelper->nestedList($list);
foreach($arragedList as $arrangedImages){
echo $this->Html->image($$arrangedImages['imageName'],
array('alt' =>$$arrangedImages['altTag']));
}
Hope it will help!