I need to use libraries in Codeigniter version 2.1.4 and I'm having trouble using these libraries myself. After loading the library (with $this->load->library('Nomedabiblioteca');
in my controller ), I have the line of code:
$a = $this->Nomedabiblioteca->teste();
To receive the return of the method teste()
of the class. However, in this line of code, the controller returns the following error:
How can I resolve this situation? What am I doing wrong?
The library code is as follows (code for testing):
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Nomedabiblioteca{
public function teste(){
$a = 'algo';
return $a;
}
}