How to get project folder base path using codeignter?

The name of the picture


How to get project folder base path using codeignter?



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





Possible duplicate of How do I get the project basepath in CodeIgniter
– Badiparmagi
Jul 10 at 12:11




3 Answers
3



You can use this way in codeigniter:


<?php echo base_url()?>



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' />



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');






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

How to scale/resize CVPixelBufferRef in objective C, iOS

Stripe::AuthenticationError No API key provided. Set your API key using “Stripe.api_key = ”

SVG with two text elements. When one resizes due to textLength - how to resize the other one to the same character size