Welcome Guest, Not a member yet? Register   Sign In
oops in codeigniter
#3

Read some example class in the core CI and find them. OR why dont you build some libraries class ? it is everywhere.
Here let's do it:
Code:
/*
**Foo.php
*/
class Foo{
function tellFoo(){
   return 'Im a foo';
}
}
//Ok put it in library folder
then you can call it in any controllers or models so on such as

class Hello extends CI_Controller{
function __construct(){
    $this->load->library('foo');
}
function greet(){
    print $this->foo->tellFoo();//use it with func tellFoo()
}
}
Reply


Messages In This Thread
oops in codeigniter - by dayakar - 08-18-2017, 10:11 PM
RE: oops in codeigniter - by Kaosweaver - 08-21-2017, 05:02 AM
RE: oops in codeigniter - by ciadvantage - 08-23-2017, 03:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB