0

Iam creating an image link in cakephp using html tag, i have a problem with adding src path.

I tried

<a href="#today1" id="lnk3">
 <img  src="/iserprofiles/app/webroot/img/todaysallocation.png">Todays Allocation</a>

but image is not loaded. if anybody know please reply. i know that we can also create image link using cakephp, but i faced one problem

i u sed this code

  <?php echo $this->Html->link($this->Html->image('todaysallocation.png',
  array('width' => '200', 'height' => '45')) ,
                   '#today',array('escape' => false));?>

i dont want to use any controller or action as url, simply i just added '#today', but my problem is i need to add one id for this. how can we done this????

1
  • 3
    I recommend using a proper virtual host setup for your local environent ( dereuromark.de/2011/05/29/working-with-domains-locally ). Then your Html->image('todaysallocation.png') will result in a proper src path /img/todaysallocation.png which then will also work properly once you deploy to the live server. Commented Jun 22, 2013 at 9:41

1 Answer 1

1

Check in Your browser patch: localhost/iserprofiles/app/webroot/img/todaysallocation.png , but i think the problem is in Your .htaccess file, because path to image will look like localhost/iserprofiles/img/todaysallocation.png

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

4 Comments

when i try to access localhost/iserprofiles/app/webroot/img/todaysallocation.png it shows object not found
I think that, check 2nd path
sorry when i change iserprofiles to my project folder name, it shows the image, before i given the controller name..now im getting..but my doubt is this is in local host, but when i host this, is there any problem with this link???
What kind of server You have on localhost?

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.