0

i'm trying to get an image to display in the cupcake forum and it is not displaying. Only the alt is showing up. Can someone tell me on what i'm doing wrong? My code:

  <?php echo $html->image('/forum/vendors/img/goto.png', array('alt' => 'goto', 'url' => array('controller' => 'topics', 'action' => 'view', $category['lastTopic_id'], 'page' => $category['LastTopic']['page_count'], '#' => 'post_'. $category['lastPost_id']))); ?>

thank you.

2
  • Where is the image supposed to be? Commented Jan 6, 2012 at 1:29
  • in c:/websites/merry_flowers/plugins/forum/vendors/img/ Commented Jan 6, 2012 at 5:05

1 Answer 1

1

Cakephp's image URLs are relative to /app/webroot/img/, so assuming your app is named merry_flowers, you should have:

<?php echo $html->image('../../plugins/forum/vendors/img/goto.png', /*Rest goes here */; ?>

Or something similar, depending on your directory structure.

Sign up to request clarification or add additional context in comments.

3 Comments

i tried swiecki's first suggestion: '../../plugins/forum/vendors/img/goto.png' and it is not working.
Do a mental exercise: start in the webroot/img/ directory, then for every directory level up you have to go, add a ../ to the path. Once you are at your app level, add the folders that you navigate through to get to your image.
I had just put the directory level according to what i see in windows explorer which is what I told you earlier ../../plugins/forum/vendors/img/goto/png'. Ok, i guess i just have to keep trying. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.