Wednesday, October 26, 2011

How to use $Html->link with both Image and $title together

Hi:
I am stuck. Can you help with this?
I would like to generate a <a> link that should like this...


<a href="/users/reset" class="regular"> <img src="/img/
resetpasswd.png" alt="ResetPassword" />Forgot Password</a>


My $html->link looks like this...

<?php echo $this->Html->link($this->Html->image("resetpasswd.png",
array("alt" => "ResetPassword")), "users/reset", array('class'
=>'regular', 'escape' => false));
?>

The result looks like this...
<a href="/users/reset" class="regular"> <img src="/img/
resetpasswd.png" alt="ResetPassword" /></a>

When I use Image, I can't seem to add body for <a> tag "Forgot
Password" as shown above. Can you help me with this? I am really
lost...

Blues Clues

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: