[eluser]sentinel[/eluser]
Hi,
Sorry to come back to this, but I'm no further forwards.
I did a fresh install, and went through everything carefully.
The strange thing is when I bult a simple stripped down test controller, it worked like it is meant to do. This is what I used:
Code:
<?php
class Temp extends Controller {
function Temp()
{
parent::Controller();
}
function index(){
$data['title'] = 'Investment Bond Toolkit';
$data['header'] = 'Manage Saved Bonds';
$data['content'] = $this->load->view('temp',$input, TRUE);
$this->load->vars($data);
$this->load->view('maintemplate');
}
}
?>
And for the view:
Code:
<table class="maintable">
<tr>
<td width="5%"> </td>
<td width="35%"> </td>
<td width="30%"> </td>
<td width="10%"> </td>
<td width="10%"> </td>
<td width="10%"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
Now, if I compare it to another controller, there is no fundamental difference in the way it renders the views:
Code:
<?php
class Policyholders extends Controller {
function Policyholders()
{
parent::Controller();
$this->load->model('policyholders_model','',TRUE);
}
function index(){
//
// Check if User ID has been set
$input['policyholders'] = $this->policyholders_model->load_policyholders();
// Create array with FORM elements to pass to view
$input['page'] ='policyholders';
$form_attributes = array('id' => $input['page'], 'name' => $input['page']);
$input['open'] = form_open('policyholders', $form_attributes);
$input['close'] = form_close();
$input['firstName'] = form_hidden('firstName', '');
$input['surname'] = form_hidden('surname', '');
$input['policyholderId'] = form_hidden('policyholderId', '');
$input['process'] = form_hidden('process', '');
$form_attributes = array('id' => $input['page'], 'name' => $input['page']);
$rules['process'] = "required";
$rules['firstName'] = "trim|required";
$rules['surname'] = "trim|required";
$rules['policyholderId'] = "trim|required";
$this->validation->set_error_delimiters('<div class="error">ERROR! ', '</div>');
$this->validation->set_rules($rules);
$fields['process'] = "";
$fields['firstName'] = "";
$fields['surname'] = "";
$fields['policyholderId'] = "";
$this->validation->set_fields($fields);
if ($this->validation->run() == FALSE)
{
$this->load->view('policyholder');
}
else
{
if($this->input->post('process') == "redirect") {
$newdata = array('policyholderId'=> $this->input->post('policyholderId'));
$this->db_session->set_userdata($newdata);
$newdata = array('ammend'=> '1');
$this->db_session->set_userdata($newdata);
header('location: '.site_url().'policyholder');exit;
}
if($this->input->post('process') == "delete") {
$this->policyholders_model->delete_policyholder();
header('location: '.site_url().'policyholders');exit;
}
}
$data['title'] = 'Investment Bond Toolkit';
$data['header'] = 'Edit or Delete Policyholders / Beneficiaries';
$data['content'] = $this->load->view('policyholders',$input, TRUE);
$this->load->vars($data);
$this->load->view('maintemplate');
}
}
?>
I just can't see where the problem lies.
I would guess it has to lie in the controllers or views (I doubt the models have any bearing on it). And I've been over the config files so many times that I can't see anything out of place there.
Any other suggestions would be appreciated, otherwise I'll just have to abandon the upgrade and stick with the existing version.
Many Thanks.
Neil.