Reputation: 20565
im trying to set up an email.
Now everything is working fine however i cannot seem to get the images into my email.
I have used the following code:
<?php echo $this->Html->image("udlejning-img/Udlej-logo.jpg", array(
"alt" => "logo",
'url' => array('controller' => 'home', 'action' => 'index')
)); ?>
However this did not seem to work (note that i am using this code somewhere else where the picture is displayed normally)
Upvotes: 0
Views: 191
Reputation: 4177
Just try this. this will give you the absolute image path as well as absolute url for your logo.
<?php
echo $this->Html->link(
$this->Html->image("udlejning-img/Udlej-logo.jpg", array(
"alt" => "logo",
'fullBase' => true
)), array(
'controller' => 'home', 'action' => 'index', 'full_base' => true
), array( 'escape' => false));
?>
Upvotes: 0
Reputation: 449
Set "fullBase" true. Otherwise the image url will be relative to your server
<?php echo $this->Html->image("udlejning-img/Udlej-logo.jpg", array(
"alt" => "logo",
'url' => array('controller' => 'home', 'action' => 'index'),
'fullBase' => true
));?>
Upvotes: 2