-2

Am working at codeigniter project. I want base url for the project folder inside controller class.

Cœur
  • 37,241
  • 25
  • 195
  • 267
inbarasan
  • 11
  • 3
  • 8
    Possible duplicate of [How do I get the project basepath in CodeIgniter](https://stackoverflow.com/questions/17188594/how-do-i-get-the-project-basepath-in-codeigniter) – Badiparmagi Jul 10 '18 at 12:11
  • You have `FCPATH` for the front controller whicj is the same dir of `index.php` and `APPPATH` for the apllication dir and `VIEWPATH` for the views dir and `BASEPATH` for the system dir. – Sherif Salah Jul 07 '19 at 00:55

2 Answers2

0

You can use base url like this way:

<?=base_url()?> or <?php base_url()?>

for example: if you want to link you js files which is in your base path

<script src='<?=base_url()?>js/jquery.js' type='text/javascript' />
Gabrielle-M
  • 1,037
  • 4
  • 17
  • 39
0

You can add base url from any where its global variable

base_url();

if still don't get base url then have to edit config/autoload.php as

$autoload['helper'] = array('url');