08-28-2015, 11:14 AM
(This post was last modified: 08-28-2015, 11:15 AM by groovebird.)
Hi,
i have a subtemplate with the following content:
and this is my controller:
but i got en error "undefined variable name". How can i pass the data to this subview?
Is the only way the following solution: (this is the home-view). I prefer only variables in my views and not an call of this->load->view()
i have a subtemplate with the following content:
Code:
<div>
<?php echo $name; ?>
</div>
and this is my controller:
PHP Code:
$view_data['subview'] = $this->load->view('subview',NULL,true);
$view_data['name'] = 'John';
$this->load->view('home',$view_data);
but i got en error "undefined variable name". How can i pass the data to this subview?
Is the only way the following solution: (this is the home-view). I prefer only variables in my views and not an call of this->load->view()
Code:
<div>
$this->load->view('subview')
</div>