Use the Html helper to include elements in your page, it deals with
the place of Cake files in the webroot
instead
<img src="chocolate_cake/img/picture.jpg" />
do
$html->image('picture.jpg');
The helper will automatically look into img/ folder. And if your site
is in a webroot's subfolder, it will see it too, and produce correct
HTML code.
Move your app, and it will still work
Same thing for CSS, JS, ...
On 23 mar, 15:47, "korcs" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a little problem with my webroot.
>
> I have my whole cake dir structure in a dir called 'cholocate_cake'.
>
> I am using a database, where the html code of the pages stored.
> This code contains some links and images as well.
>
> All of these links and images are working with relative adresses (f.e.
> for images: 'src="img/picture.jpg"', where the picture.jpg is in the
> './img/' directory).
>
> Now I found, that when I copy the content of the old img directory
> into the app/webroot/img directory, then the pictures are not
> displayed. Only if I change the links to 'src="chocolate_cake/img/
> picture.jpg"'.
>
> Do you know which is an elegant solution for this?
>
> Best,
>
> korcs
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---