Thursday, September 16, 2010

HtmlHelper->image(), can you make it use full base url instead of relative url?

I want to make sure HtmlHelper outputs a full path image eg:

currently:

echo $this->Html->image('myimage.gif')

becomes

<img src="../img/myimage.gif" />

i would like to do this:

echo $this->Html->image('myimage.gif', array('full' => true))

to get this output:

<img src="http://www.myurl.com/img/myimage.gif" />

Am I missing something that already exists? I know I could just put
the full base url in as the image file name, but sometimes I use
different domains for the same image file e.g. logo.png

Thanks guys

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate