php - How to get project folder base path using codeigniter?

338

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

941

Answer

Solution:

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

Answer

Solution:

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

People are also looking for solutions to the problem: php - APNs "Extracting push notification package failed"

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.