Can I declare a variable or global variable which is accessible in all files whether controller,model,view and set a value for it when call it from the current file??
You can create a core controller (MY_Controller) and initiate all your variables there and have you controllers extend MY_Controller instead of CI_Controller