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');
精彩评论