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

#1
[eluser]yusrialfiansyah[/eluser]
I would create class like this :

http://mydomain/admin/student/add

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

Can someone help me?? thanks before.

#2
[eluser]srisa[/eluser]
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.

#3
[eluser]TheFuzzy0ne[/eluser]
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.

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

#5
[eluser]yusrialfiansyah[/eluser]
So i can't use this folder structure ya? And I should mix my admin-class into one folder 'admin'.
Or any solution there?

#6
[eluser]TheFuzzy0ne[/eluser]
The solution srisa posted will work. I was just pointing out that you can't nest controllers any deeper than you have.

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

http://ellislab.com/forums/viewreply/519469/


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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