0

My base url function is not working in the latest version of code igniter. Trying to use it in a style sheet path, and then just echoed it on a view to see if it worked there, to no avail.

calling it this way:

<?php echo base_url(); ?>

and then with the style sheet like so:

<link rel="stylesheet" href="<?php echo base_url(); ?>css/style.css" type="text/css" media="screen" charset="utf-8"/>

And here it is assigned in my config.php file:

$config['base_url'] = 'http://www.codeigniter.dev/';
$config['server_root'] = $_SERVER['DOCUMENT_ROOT'];

Any ideas?

1 Answer 1

3

as guide

$this->load->helper('url');

is the library loaded?

Sign up to request clarification or add additional context in comments.

6 Comments

oh duh, good point. which page should I load it on? the controller for the view I'm trying to use it on, or is there a more universal spot?
you can load it in the controller (when it's needed) or use the autoload codeigniter.com/user_guide/general/autoloader.html
just for future reference. I had this in my autoload.php $autoload['helper'] = array('url'); would that not do it?
ok - that makes sense but it's still not working. That is what I've had in it all along :(
I figured it out. I had to combine the form helper within the url helper and it worked. thanks
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.