HTML special characters in $title
will be converted to HTML entities. To disable this conversion, set the escape option to false in the $options
array.
echo $this->Html->link(
$this->Html->image("recipes/6.jpg", array("alt" => "Brownies")),
"recipes/view/6",
array('escape' => false)
);
?>
Sunday, March 27, 2011
Nak Paparkan Gambar beserta link di dalam CakePHP 1.3
Nak Paparkan Gambar beserta link di dalam CakePHP 1.3
CakePHP 1.2: $html->link with html or image.
A good tutorial for CakePHP I took from DLMax, thanks Max!!!
In CakePHP 1.1 if you need to display an image or piece of HTML with a link to an action, you need to instruct cake NOT to escape the contents of the “Title” attribute with the last false statement like this:
e( $html->link( $html->image("add.gif"), array('action' => 'add'), array(), null, false ));
In CakePHP 1.2 you could rewrite this to:
e( $html->link( $html->image("add.gif"), array('action' => 'add'), array('escape' => false)));
Subscribe to:
Posts (Atom)