开发者

How to override the public images directory in CakePHP?

/cake/con开发者_如何学运维fig/paths.php

/** * Path to the public images directory. */ define('IMAGES', WWW_ROOT.'images'.DS);

/** * Web path to the public images directory. */ if (!defined('IMAGES_URL')) { define('IMAGES_URL', 'images/'); }

How do I override the above constants that are set in /cake/config/paths.php ? Would I set them in /app/config/bootstrap.php ? If so, what is the correct syntax?

Thanks


Depends how you want to use them.

If you're keeping images somewhere else and want to use the html->image helper, you can specify a new location relative to root simply by prepending a /directory, viz:

echo $html->image('/myImages/face.jpg');
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜