Welcome Guest, Not a member yet? Register   Sign In
Can you assign a base url for a particular folder in your config file?
#1

[eluser]Zombie1[/eluser]
Hello all,

I've been working with CodeIgniter for close to a week and have a question. If my base url in the config file is:

$config['base_url'] = 'http://localhost/index.php/';

This base url works fine as my program runs successfully, however, is it possible to assign, for example, an image or CSS folder inside the config file?

The reason I'm asking this is I have a large program and inside this program there are numerous files. Here's a snippet of code:

Code:
<link rel="stylesheet" href="<?php echo base_url('media/css/stylesheet.css');

When my program runs it doesn't display the css correctly, however, when I change the path to:

Code:
<link rel="stylesheet" href="<?php echo base_url('../../media/css/shadowbox.css');

This works fine. I could change the path manually but there's too many instances as well as too many pages.

Is there any way I can create a new path inside the config file in order for it to point to the correct folder? As I said at the beginning I'm pretty new to CodeIgniter so I'm assuming the 'base_url()' function points to the base url in the config file. Thanks in advance.


Messages In This Thread
Can you assign a base url for a particular folder in your config file? - by El Forum - 06-28-2014, 01:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB