I have a model which passes one record to my controller but I keep receiving these two errors
Message: Missing argument 1 for Quotes_model::get_records(), called in /home/digibite/public_html/development/quote/application/controllers/welcome.php on line 12 and defined
Message: Missing argument 2 for Quotes_model::get_records(), called in /home/digibite/public_html/development/quote/application/controllers/welcome.php on line 12 and defined
I have been playing around with this for almost an hour and can't get my head around it.
My model
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Quotes_model extends CI_Model{
function __construct(){
parent::__construct();
}
function get_records($limit, $offset){
$query = $this->db->select('*')
->from('quotes')
->join('authors', 'authors.id = quotes.author_id')
->join('genre', 'genre.id = quotes.id')
->order_by('id', 'RANDOM')
->limit($limit, $offset);
$data = array();
$data[] = array (
'title' => $row->title,
'slug' => $row->slug,
'meta_keys' => $row->meta_keys,
'meta_description' => $row->meta_description,
'content' => $row->content,
'views' => $row->views,
);
return $data;
}
}
And this is my controller
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
$this->load->helper('url');
$this->load->model('quotes_model');
$data['quote']= $this->quotes_model->get_records();
$this->load->view('welcome_message');
}
}