Why is this line not working in constants.php :-
define('FILE_UPLOAD_VIRTUAL_DIR', base_url() . '/uploads/');
base_url() works in all views. Then why not in constants.php?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Probably because
constants.phpis included before the library definingbase_url()is.I don’t know CI, but look if there is any chance to define the constant at a later point in the program flow. A CI expert may be able to tell you in more detail where exactly.