Welcome Guest, Not a member yet? Register   Sign In
Controller subclasses
#1

[eluser]Naki[/eluser]
Hi all!

I'm new to CI, I've read the docs and tutorials and it looks really good ^^.

So I went to step 2 : coding for my real app :p . And then, I'm a bit lost on how to create a clean classes hierarchy (so this post is quite a mix between questions and Work In Progress, as I'm writing and trying at the same time Wink )

Here is what I'd like to have :
Code:
Controller
  |- Class1
  |   |- Subclass11
  |   |- Subclass12
  |   |- Subclass13
  |
  |- Class2
      |- Subclass21
      |- Subclass22

First, I've tried to create everything in my application/controllers folder, but then I have a "Class not found" error when I try to write
Code:
class Subclass11 extends Class1

Then I've read the doc again, and it seems that Class1 and Class2 should be libraries, is it right?

Finally, I've been able to create subclasses (in controllers) if Class1 and Class2 are created in application/libraries/MY_Controller.php. But if I have 10 classes, it will become difficult to read all classes in the same file. Is it possible to write them in separate files?

Thanks a lot for your help!


Messages In This Thread
Controller subclasses - by El Forum - 12-20-2007, 08:19 AM
Controller subclasses - by El Forum - 12-20-2007, 09:22 AM
Controller subclasses - by El Forum - 12-20-2007, 12:21 PM
Controller subclasses - by El Forum - 12-21-2007, 02:07 AM
Controller subclasses - by El Forum - 01-21-2008, 11:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB