• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Class in nested folder

I would create class like this :


but i want to place my 'student' class in folder controller/admin/student/student.php

Can someone help me?? thanks before.

If your folder structure is .system/controllers/admin/student/student.php , then url to access the add function in student class will be http://mydomain.com/admin/student/student/add. If you want to do away with the extra student in the url, place student.php in the .system/controllers/admin/ folder.

One more thing to note is that you can only nest controllers up to one subdirectory deep.

./system/application/controllers/admin/student.php - You can easily access this.

./system/application/controllers/admin/student/student.php - You won't be able to access this controller.

No, i can't access it, even I use URL : http://mydomain.com/admin/student/student/add
Or i just forget some configuration there?

So i can't use this folder structure ya? And I should mix my admin-class into one folder 'admin'.
Or any solution there?

The solution srisa posted will work. I was just pointing out that you can't nest controllers any deeper than you have.

[eluser]Phil Sturgeon[/eluser]
For more admin-related separation techniques, take a look at this post:


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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