codeigniter base_url inside constants file
Currently I display images in the following way: <img src="<?php echo base_url().USER_UPLOAD_URL.$post['userPhoto'] ?>" /> USER_UPLOAD_URL is defined inside application/config/constants.php. define('USER_UPLOAD_URL', "uploads/user_uploads/"); Is there any way to include base_url() inside constants.php? In this way I wouldn't need to write each time base_url() inside view. Is there any alternative approach? tnx constants.php loading before config.php, so you can't use $config['base_url'] from constants.php. But you can do something like that: constants.php : define('BASE_URL', "http://mysite