Welcome Guest, Not a member yet? Register   Sign In
custom Class
#1

[eluser]hugle[/eluser]
Hello everybody.

well, as usual every day, you learn smth new Smile

Now I'm playing with my old class called - domain

so I saved the file under library directory,

renamed from
Code:
class domain {
to
Code:
class MY_domain {

then in the controller:
$this->load->library('domain');

but here is a stop for me .. How do I work now?
Yearlier my procedure was :

$domain=new domain("codeigniter.com");
echo $domain->info()."<br>";

well, i'm stuck here and don't know how to move on now Smile

Any help appreciated guys !

thanks
#2

[eluser]gon[/eluser]
You only must put the MY_ when extending core CI classes.
So just rename the class back to Domain, and it should work.
#3

[eluser]hugle[/eluser]
Hello
when i use: class domain {

and:
Code:
function index()
    {
        $this->load->library('domain');
        echo 'a';
    }
While accessing the controller I get blank screen.

If I rename class domain to: class MY_domain
while accessing the controller I get 'a' as expected.

Any other thoughts?




Theme © iAndrew 2016 - Forum software by © MyBB