CodeIgniter Forums
Template library: Different title for same view depending on loaded data - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Template library: Different title for same view depending on loaded data (/showthread.php?tid=46444)



Template library: Different title for same view depending on loaded data - El Forum - 11-01-2011

[eluser]cmh24[/eluser]
Hi everybody,

I have a question about Phil Stuergon's template library. I got it working together with HMVC.

Now I want to set a specific title depending on the content I am loading.

Code:
public function event($id)
{
  $data['companies'] = $this->front_model->get_companies($id);
  
  $this->template->title('....');
  $this->template->build('event', $data);  
}

So depending on the id I want a different title in the view. How can I accomplish this?
Something like $company->name, but this does not work.
So, who can help me?

Thanks!
Max