[eluser]sbarow[/eluser]
Hi,
Very new to Codeigniter.
I have a controller that gets the title of a product category
Code:
$this->Product_model->get_title($id);
the result is the returned as an array, I want to make this array equal to my heading i.e.
Code:
$data['heading'] = $this->Product_model->get_title($id);
in my view in order to show the result I have to use a foreach statement
Code:
foreach($sub_heading as $item) {
$sub_title = $item->title;
}
This just seems to be a long way round, is there a simpler, cleaner way of doing this, such as
Code:
$title = $this->Product_model->get_title($id);
$data['heading'] = $title;
Then in the view just echo $heading?
Look forward to seeing what can be done, thanks.