How do I get the project basepath in CodeIgniter

前端 未结 6 725
失恋的感觉
失恋的感觉 2020-12-15 03:22

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

6条回答
  •  我在风中等你
    2020-12-15 03:29

    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;
    

提交回复
热议问题