0

/cake/config/paths.php

/** * 公共图像目录的路径。*/ 定义('IMAGES', WWW_ROOT.'images'.DS);

/** * 公共图像目录的 Web 路径。*/ if (!defined('IMAGES_URL')) { define('IMAGES_URL', 'images/'); }

如何覆盖 /cake/config/paths.php 中设置的上述常量?我会将它们设置在 /app/config/bootstrap.php 吗?如果是这样,正确的语法是什么?

谢谢

4

1 回答 1

0

取决于你想如何使用它们。

如果您将图像保存在其他位置并想使用 html->image 帮助程序,您可以简单地通过添加 /directory 来指定相对于 root 的新位置,即:

echo $html->image('/myImages/face.jpg');
于 2010-07-14T14:24:46.657 回答