Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含一些 HTML 的页面。我需要将 src 属性设置为图片的位置。
如何使用 Kohana PHP 实现这一目标?
谢谢。
这取决于图像的位置。在标准的 Kohana 安装中,这些文件位于您的文档根目录中,并且可以通过 url::file() 调用访问,例如:
<?php echo url::file("images/foo.gif") ?>
将指:
http://example.com/images/foo.gif
参考:http ://docs.kohanaphp.com/helpers/url#file