Am working at codeigniter project. I want base url for the project folder inside controller class.
Asked
Active
Viewed 333 times
-2
-
8Possible 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 Answers
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');

Rahul kalal
- 51
- 6