I have created a folder as user in the root directory.
My project base path is:
/var/www/myproject/
When I want to access the base path as BASEPATH from a controller it's showing:
/var/www/myproject/system/
But I want the path to be:
/var/www/myproject/
I am new to CodeIgniter. How do I set this path?
Use FCPATH instead of BASEPATH for more check this link.
Codeigniter - dynamically getting relative/absolute path outside of application folder
use base_url()
echo $baseurl=base_url();
if you need to pass url to a function then use site_url()
echo site_url('controller/function');
if you need the root path then FCPATH
..
echo FCPATH;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With