Hi,

I have been using PHP for a number of years now and understand a good amount of OOP (Interfaces, Design Patterns and what not).

I wanted to understand how the Super Object class in CodeIgniter works. I know it uses a Singleton design pattern to return an object, but I don't quite understand how the other classes make use of this, since all clases don't have this implementation?

I think the database classes, libraries are referenced to the super object and are all accesible from that? I'm not sure.

If someone could provide a small example that would be fantastic.

Kind Regards,
-Mathew

    Isn't code igniter PHP4? I was looking though the source the other week.

    Surly you can't implement a singleton within a php4 environment?

      It's both.

      Base5.php is the code it will use in a PHP 5 environment

        Write a Reply...