I want to pass an array to a view from a controller. I tried to use the code below. I know it is wrong, but cannot think of what to use. find() function gets all rows from table, and then i want to pass those rows as array to the view. How can i do so?
<?php
class Blog extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->model('blog_model');
}
public function index(){
$data = $this->blog_model->find(); //which gets all entries from table
$this->load->view('template/header');
$this->load->view('template/content', $data);
$this->load->view('template/footer');
}
public function create(){
$this->blog_model->create();
}
public function delete(){
}
}
?>