I have a model that fetches from my database a list that I want to be able to show in my view.
The model looks like this:
Class Model_services extends Model
{
public function get_services_list() {
$result = DB::select('*')->from('services')
->execute()
->as_array();
return $result;
}
}
My controller looks something like this:
public function action_index()
{
$this->template->title = "services";
$this->template->header = View::factory('header');
$services = Model::factory('services');
$this->template->content = View::factory('services')
->bind('result',$result)
$this->template->footer = View::factory('footer');
}
How do I render at the view the variables from the model?