Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6243705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:11:34+00:00 2026-05-24T12:11:34+00:00

I wish to use the $html->image(…) helper function in CakePHP to output images, but

  • 0

I wish to use the $html->image(...) helper function in CakePHP to output images, but I need it to produce an img tag using an absolute rather than relative URL (the resulting HTML will be downloaded and emailed round in a company newsletter). Is this possible?

It’s not documented, but I notice from looking at the source code that the image function can take an array as its first argument. It’s not entirely clear to me how to get this working though – a naive attempt to do it this way produces image URLs relative to the current page rather than within the webroot/img folder.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:11:34+00:00Added an answer on May 24, 2026 at 12:11 pm

    In CakePHP 1.x the method is:

    $this->Html->image($this->Html->url('/path_to_image/image.png',true));
    

    In CakePHP 2.x the method is:

    $this->Html->image('/path_to_image/image.png', array('fullBase' => true));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to use the Translator classes of Zend framework in my app, but
I have two stored procedures I wish to use in my stored procedure, but
We use JQueryTools library (http://flowplayer.org/tools/index.html), but haven't seen any progress in last 12 months
As recommended by http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-static-resources I wish to use <mvc:resources> for serving my spring static
HTML code: <div id=img-wrapper> <img src=images/1.png title=Picture 1 class=my-img /> <img src=images/2.png title=Picture 2
I'm new to JQuery, but wish to use it in a site that I'm
I wish to use/embed html content (in this case a list <ul> ) at
I wish to use xml and xsl to generate controls on an asp.net page.
I wish to use the Validating event on a label in VB.Net (Visual Studio
I wish to use the Tomcat install/deploy tasks from catalina-ant.jar to deploy a webapp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.