Welcome Guest, Not a member yet? Register   Sign In
I cannot find my files
#1

[eluser]l2eqless[/eluser]
First off, I'm new to CodeIgniter, so I feel like I am just looking at this the wrong way.

Heres what my view folder looks like:

Views
->includes
->header.php
->footer.php
->template.php (which uses <?php $this->load->view()?> to load the individual files
->images
->css
->index.css

My problem is that within the header I use:
Code:
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/index.css');?>">
Yet it does not load this stylesheet.

A few things:
-I have the url helper auto-loaded
-in my config.php file, my base_url is set to 'http://localhost/way2project/' and my index_page is the default 'index.php'
-images aren't found when i use a similar base_url() function.

Similarly I cant find the image/css files when I type in:
localhost/way2project/index.php/css/index.css (gives 404 page not found)
or
localhost/way2project/css/index.css (gives object not found)

Any help would be greatly appreciated!
#2

[eluser]l2eqless[/eluser]
Also, my Controller looks like this:
Code:
<?php
Class Content extends CI_Controller {
public function index() {
  $data['main_content'] = "home.php";
  $this->load->view('includes/template', $data);
}
}
?>
#3

[eluser]CroNiX[/eluser]
anything in the /system and /application folder is not directly accessible via the url.

Have your structure something like this:
Code:
/site_root
  /system
  /application
  /css
  /images
  index.php
And your code above will probably work (assuming you aren't in a subdirectory).
#4

[eluser]l2eqless[/eluser]
I knew it was going to be something simple, thanks a bunch!




Theme © iAndrew 2016 - Forum software by © MyBB