Código PHP:
$this->db->get();
Cita:
Fatal error: Call to a member function query_values() on a non-object in /home/juan/public_html/okc/application/controllers/web.php on line 12A PHP Error was encountered
Severity: Notice
Message: Undefined property: Web::$transactor
Filename: controllers/web.php
Line Number: 12
Severity: Notice
Message: Undefined property: Web::$transactor
Filename: controllers/web.php
Line Number: 12
Aqui dejo el codigo de mi controlador y mi modelo:
Código PHP:
<?php
class Transactor extends CI_Model{
private $exec;
public function __construct(){
parent::__construct();
}
public function query_values($table_name){
$this->exec = $this->db->get($table_name);
}
public function get_resultset(){
return $this->exec;
}
}
?>
Código PHP:
<?php
class Web extends CI_Controller {
function __construct(){
parent::__construct();
}
function index()
{
$this->load->model('Transactor','',TRUE);
$this->transactor->query_values('tbrequest');//esta es la linea de error
$data['todo_list'] = $this->transactor->get_resultset();
$data['title'] = "My Real Title";
$data['heading'] = "My Real Heading";
$this->load->view('welcome_message',$data);
}
}
?>