Welcome Guest, Not a member yet? Register   Sign In
Organizing Controllers into Sub-Directories
#4

(This post was last modified: 04-30-2015, 12:21 PM by eci35.)

(04-30-2015, 11:59 AM)mwhitney Wrote: You may be able to get this to work with a creative routes.php, but the main problem is probably the fact that you are trying to use a controller and directory with the same name (as far as routing is concerned) at the same level.

In other words, when you go to /members/summary, it looks for a method in your Members controller named summary. If you did not have a Members controller, it would look in the members directory for the Summary controller. As far as I can tell, it will not look for the directory as long as the controller of the same name exists.

OK. I pulled it apart and the sub-directory structure works now. The new structure is as follows:
Code:
-www
--application
---controllers
----members
-----Login.php
-----Logout.php
-----Summary.php
-----Welcome.php (default controller)
--views
---members
----login.php
----summary.php
----welcome.php
--assets
--system
--.htaccess

Thank you @mwhitney.

Edit: @RobertSF's response came through while I was composing that response. Thank you @RobertSF as well.
Reply


Messages In This Thread
RE: Organizing Controllers into Sub-Directories - by eci35 - 04-30-2015, 12:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB