setting 'url' options in image can do the trick too. $this->Html->image($image['Image']['thumb_path'], array( 'alt' => $title ,'url' => $yoururl));
On Tuesday, 23 October 2012 12:08:13 UTC+8, bs28723 wrote: > > I would like to use Html->image and Html->link together, but Html->link > will convert characters like <, ", etc to htmlize them. > > for example > $imgTag = $this->Html->image($image['Image']['thumb_path'], > array( 'alt' => $title )); > $options = array('class' => 'thumb', 'name' => > trim(Inflector::slug($title)), 'title' => trim($title)); > > echo $this->Html->link($imgTag, > $this->Html->url($image['Image']['small_path'],true), $options); > > Will actually produce > > <a href="/2d3cf4770eefa1244464b0371009c2b0_resized_250x188.jpg" class="thumb" > name="tree" title="tree "> > <img src="/2d3cf4770eefa1244464b0371009c2b0_resized_100x75.jpg" > alt="tree " /></a> > > Yes the < etc is really in the file, so the image does not get recognized > by the browser as HTML. But it just gets displayed as text. > > Any way to get the Html->link to not convert the string? > Or do I need to just build this manually? > > > > ------------------------------ > View this message in context: Allow special characters in > HtmlHelper<http://cakephp.1045679.n5.nabble.com/Allow-special-characters-in-HtmlHelper-tp5711911.html> > Sent from the CakePHP mailing list > archive<http://cakephp.1045679.n5.nabble.com/>at Nabble.com. > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.