You can also use the image method from the html helper. echo $html->image('my_logo.jpg');
On Sat, Jan 3, 2009 at 12:51 PM, brian <bally.z...@gmail.com> wrote: > > On Sat, Jan 3, 2009 at 6:07 AM, piyushsharmajec > <piyushsharma...@gmail.com> wrote: > > > > > > How can one show image either logo or any other from layout file as this > file > > is present in webroot folder so there is confution over image address. > > Thanks > > It does not matter that the layout file is stored in > app/views/layouts/ and the images in app/webroot/img. The layouts > directory is simply a folder to store template files; they are not > "served" from there in the same manner as, say an HTML file would be. > Any paths inside of a layout file should be relative to root > (app/webroot/) not the layouts directory. > > So, if you have an image file at app/webroot/img/my_img.png you can > put the following in your layout: > > <img src="/img/my_img.png" alt="... > > Likewise, if you have CSS rules which refer to images, you can either > set the URLs to be relative from "root" -> url(/img/my_img.png) or > from the CSS directory -> url(my_img_foloder/my_img.png) > > where the latter refers to an image stored at > app/webroot/css/my_img_foloder/my_img.png and the former to the > regular img directory. > > > > --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---