Why is the escape parameter not recognized in the Cakephp Htmlhelper?

Asked

Viewed 62 times

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']));?>

Upshot

<a href="/documents/admin_view/130">Visualizar&lt;img src="/img/icone_visualizar.png" alt="" /&gt; |  </a>
  • Have you tried uppercase H?

  • but the Htmlhelper object is being considered, so much so that it appears the link and the image in html at the end , but the image appears in string form

1 answer

3

It seems to me that you are passing the 'escape'=>false in the second parameter, which is the $url, when according to the documentation it must 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);?>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.