[eluser]zimco[/eluser]
Using CI 1.6.1
I'm not getting how to use a css file and any style related images in an images folder.
I put the following lines in the /system/application/config/config.php
Code:
/*
|--------------------------------------------------------------------------
| CSS - stylesheets
|--------------------------------------------------------------------------
|
| Set some stylesheet
|
*/
$config['css'] = "default.css";
Then created a controller Home like:
Code:
class Home extends Controller {
var $base;
var $css;
function Home()
{
parent::Controller();
$this->base = $this->config->item('base_url');
$this->css = $this->config->item('css');
$this->load->helper('url');
$this->load->helper('form');
}
/*======================================================================*\
Function: index()
Purpose: Provide the website entry home page
Input:
Output: Display home page view
\*======================================================================*/
function index()
{
$data['css'] = $this->css;
$data['base'] = $this->base;
// load the header view
$data['header'] = $this->load->view('header', '', true);
// load the menu view
$data['menu'] = $this->load->view('menu', '', true);
// Load the page content
$data['content'] = $this->load->view('content','', true);
// load the header view
$data['footer'] = $this->load->view('footer', '', true);
$this->load->view('layout', $data);
}
My /views/layout.php page looks like:
Code:
<?php echo $header; ?>
<?php echo $menu; ?>
<?php echo $content; ?>
<?php echo $footer; ?>
The page loads but is not styled and no images appear. All i see is my page text and links. The CSS and images folder are currently located at the top level of my web-application folder: in the same folder as the system folder, user_guide folder, license file, index file.
It is probably a simple concept i am not understanding so could somebody with more CI experience and patience tell me what i am doing wrong?