开发者

CakePHP Path Rewriting for controllers/actions and image URLs

开发者 https://www.devze.com 2023-03-27 02:06 出处:网络
开发者_开发百科I am using CakePHP. I have relative paths for images being generated, stuff like \"img/1.jpg\", etc.
开发者_开发百科

I am using CakePHP. I have relative paths for images being generated, stuff like "img/1.jpg", etc.

I found with it sometimes when I call a certain action it redirects to a URL that ends with a /, sometimes it doesn't. So when it ends with something like: http://mysite.com/asdf/

then the image links break

when it goes to http://mysite.com/asdf

the images are fine. How do I standardize how that last "/" is used? Thanks!


For standardize You need to use HTML Helper for displaying images

0

精彩评论

暂无评论...
验证码 换一张
取 消