Why is not the escape parameter recognized in Cakephp's HtmlHelper?

0

When trying to create an image as a link in cakephp using HtmlHelper, the HTML code is generated as String in the browser

<?php echo $this -> html -> link(
'Visualizar'
.$this -> html -> image('icone_visualizar.png').' |  ',
 array('escape'=>false,'controller'=>'documents','action'=>'admin_view',$document['Document']['id']));?>

Result

<a href="/documents/admin_view/130">Visualizar&lt;img src="/img/icone_visualizar.png" alt="" /&gt; |  </a>
    
asked by anonymous 07.10.2014 / 17:48

1 answer

3

It seems to me that you are passing the 'escape' => false in the second parameter, which is the $ url, when second to documentation it should be passed in the 3rd parameter ($ options)

Try changing your code to something like

<?php echo $this -> html -> link(
'Visualizar'.$this -> html -> image('icone_visualizar.png').' |  ',
array('controller'=>'documents','action'=>'admin_view',$document['Document']['id']),
array('escape'=>false);?>
    
07.10.2014 / 18:36