开发者

How to override the public images directory in CakePHP?

开发者 https://www.devze.com 2023-01-07 11:51 出处:网络
/cake/con开发者_如何学运维fig/paths.php /** * Path to the public images directory. */ define(\'IMAGES\', WWW_ROOT.\'images\'.DS);

/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

精彩评论

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