Marc Rasmussen
Marc Rasmussen

Reputation: 20565

Cakephp logo in mail

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

Answers (2)

Anil kumar
Anil kumar

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));

?>

reference.

Upvotes: 0

nithin
nithin

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

Related Questions