I tried to render something like this using html helper:
<a href="#" class="some-class"><img src="url/to/image.png" alt="alt-tag" /></a>
I write this in my .ctp file:
<?php
echo $this->Html->link($this->Html->image("image.png", array("alt" => "alt-tag")),"#", array('class' => 'some-class'));
?>
But in browser, image was not displaying but simple plain text :
<img src="/url/to/image.png" alt="alt-tag" />
I did inspect element
, where everything look as what I wanted to render. I tried to edit it live, so I selected edit as html
option in inspect element. I surprised to see following code:
<a href="#" class="some-class"><img src="/url/to/image.png" alt="alt-tag" /></a>
Please not that insted of < and > it was <
and >
.
I couldn't figure out what is the problem. (I am new to cakephp).