[eluser]EthanSP[/eluser]
Why do the $data values on the first $data = $this->model->func() call cannot be retrieved on my view file? I highlighted (in red) the variable ($base) that won't show up its value:
Controller:
function demographics() {
$this->load->helper('form');
$this->load->helper('html');
$this->load->model('bangungot_model');
if($this->input->post('mysubmit')) {
$this->bangungot_model->add_entry();
}
$data = $this->bangungot_model->get_paths();
$data = $this->bangungot_model->get_fields();
$this->load->view('demographics', $data);
}
Model:
function get_paths() {
$data['base'] = $this->config->item('base_url');
$data['custom_css'] = $this->config->item('custom_css');
$data['banner'] = $data['base'].'index.php/welcome/banner';
return $data;
}
function get_fields() {
$data['title'] = 'Demographics';
$data['fid'] = array('name'=>'id');
$data['ffn'] = array('name'=>'fname');
return $data;
}
View:
...
<link href="<?= "
$base/$custom_css" ?>" rel="stylesheet" type="text/css">
...
<div class="jwin1">
<?= heading($title,3);
echo form_open('books/input'); ?>
</div>
...
<div class="jmenu">
<ul class="jdatacol"> <!-- style="width:200px;" -->
<?= "<li>".form_input($fid)."</li>"; ... ?>
<li><label><input type="radio" name="Sex" value="female" style="width: 12px;" /> Female</label>
...
</ul>
</div>
<div class="jwin3">
<? //<input name="save" type="button" value="Save changes" class="jbutton" /></div>
echo form_submit('mysubmit','Submit!');
echo form_close(); ?>
</div>
...