[eluser]ZeroLag[/eluser]
Forgive me if this doesn't turn out to be 100% CI related.
My stylesheet is being ignored on all pages except for the main page in my application.
I am calling a template from my controllers that basically sets the page layout and takes content as a variable sent from the controller as well.
View template:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title Here</title>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<link href="public/admin/css/admin_style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor='#E2E1E1'>
<div id='container'>
<div id='searchwindow'>
<div class='colheader'>Search</div>
<div style='padding: 2px;'>
<form name='searchform' action='quicksearch.php' method='GET'>
<input type='text' name='searchstring' value="<?= $string ?>">
<input type='submit' value='Search'>
</form>
</div>
</div>
<div id='contentwindow'>
<!-- Content -->
<? echo $content; ?>
<!-- End Content -->
<div>
</div> <!-- end container -->
</body>
</html>
The function calling this view looks like this:
Code:
<?php
class Home extends Controller {
function Home()
{
parent::Controller();
//Protects account controller
$this->freakauth_light->check('admin');
//Loads the model and database for this whole controller
$this->load->model('candidates');
$this->load->model('contacts');
$this->load->model('clients');
$this->load->database();
$this->load->helper(array('html_date_select', 'proficiency', 'child_age'));
//Enable profiling on this controller?
//$this->output->enable_profiler(true);
}
function index()
{
$this->view();
}
function view()
{
$data['username'] = $this->db_session->userdata('user_name');
$data['string'] = "test";
//Get the lists of all the recently added records
$data['newestCandidates'] = $this->candidates->getRecentlyAddedCandidates();
$data['newestContacts'] = $this->contacts->getRecentlyAddedContacts();
$data['newestClients'] = $this->clients->getRecentlyAddedClients();
//Get the lists of all the most recently modified records
$data['recentlyUpdatedCandidates'] = $this->candidates->getRecentlyUpdatedCandidates();
$data['recentlyUpdatedContacts'] = $this->contacts->getRecentlyUpdatedContacts();
$data['recentlyUpdatedClients'] = $this->clients->getRecentlyUpdatedClients();
//Get the list of most recently uploaded files
$data['recentlyUploadedFiles'] = $this->candidates->getRecentlyUploadedFiles();
//Load the view
$data['content'] = $this->load->view('admin/home', $data, true);
$this->load->view('admin/shared/main_template', $data);
}
}
?>
In any other controller I use, even if I simply copy/paste the view function the template is called and the page will load, but the stylesheet information is completely ignored. I know this is the case because if I comment out the <link rel="stylesheet"> tag and reload my "correctly working" controller, it looks just like all the controllers that don't work.
I don't really understand how this is possible. They all call the exact same view, and I have confirmed that everything is exactly the same by looking at the page sources in my browser. All I can conclude is that the CSS is being ignored on all pages except one.
Can anyone help?
Thanks,
Steve