I've checked and all my calls are correct. The code ran on Windows and transferred it to Ubuntu. After the download gives this error:
An Error Was Encountered
Unable to locate the model you have specified: crudmodel
The model in question (crudModel.php):
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class CrudModel extends CI_Model {
public function __construct()
{
parent::__construct();
}
public function add($tabela= NULL, $dados= NULL){
if ($this->db->insert($tabela, $dados)){
return TRUE;
}
else{
return FALSE;
}
}
public function delete($tabela= NULL, $dados= NULL){
$this->db->where('id', $dados);
if ($this->db->delete($tabela)){
return TRUE;
}
else return FALSE;
}
public function read($tabela= NULL){
$result= $this->db->get($tabela);
return $result;
}
public function buscaDados($tabela= NULL, $dados= NULL){
if ($tabela!= NULL && $dados!= NULL){
$this->db->where('id', $dados);
if ($this->db->update($tabela)){
return TRUE;
}
else return FALSE;
}
else return FALSE;
}
public function update($tabela= NULL, $dados= NULL){
if ($tabela!= NULL && $dados!= NULL){
return $result= $this->db->get_where($tabela, $dados);
}
else return FALSE;
}
}
From what I've seen, the problem is in autoload ... but I do not know how to hit that.
Autoload:
$autoload['packages'] = array();
$autoload['libraries'] = array('form_validation', 'session', 'database', 'table', );
$autoload['helper'] = array('url', 'form', 'html', 'file', );
$autoload['model'] = array('crudModel', 'sessionModel', );
Example of calling the method of the model class:
$dados= $this->crudModel->buscaDados('usuario',$dados);