• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
oops in codeigniter

#1
could you share oops in codeigniter?
Reply

#2
Object Orientated programming or mistakes?
Reply

#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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.