controller nested folders |
[eluser]iqdavidh[/eluser]
Well, I have the same trouble... When I have the controller in a folder 2 levels down: controllers/folder_level1/folder_lever2/ It doesn´t work!!! (a error 404 apears) If I move the controller to the folder_level1 it works!!!! Somebody has solves this?
[eluser]simshaun[/eluser]
Your answer is right above my last post. You can only have 1 subfolder! If you want to solve that, you need to modify the core to look down in more than one folder.
[eluser]Jagar[/eluser]
Actually with the help of http://ellislab.com/forums/viewthread/107451/#541043 you can have unlimited nested folders, view the code. You can either use the posted code, or use mine, which I customized it to fit my needs, it may even help you. Code: <?php
[eluser]TheFuzzy0ne[/eluser]
The above post is spam. Can we delete it so we aren't indexing their Web site via Google. Edit: The above post is not, I repeat not spam.
[eluser]Thorpe Obazee[/eluser]
It's been reported and it will be deleted as far as I know.
[eluser]Dam1an[/eluser]
Fuzzy, you're post will look kind of stupid once the post is deleted, as you'll be refering to a valid post as spam lol (note to self, always quote a spammer when referencing them)
[eluser]TheFuzzy0ne[/eluser]
I I have problems navigating around code that's any more than a few pages in length, so I now try to export every controller method into it's own controller, and use _remap(). So my structure would look something like this. Code: controllers Here's my take on the subject. ./system/application/libraries/MY_Router.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); The last two if statements was something I was thinking of implementing, so that apps can be more portable, and not have to know what the name of the default controller is. However, if you create a subdirectory with the same name as a PHP file that resides in the same directory, the directory will never be traversed. Blatantly obvious, but hey... And also, it's recommended that each controller directory contains a default controller. Again, this is more to do with common sense than anything else. Feel free to give this library a bash. It's been designed to be fully compatible with your current structure, so long as your structure works with CodeIgniter already. Comments and questions welcome. @Dam1an: I've edited my post above to reflect the current situation accordingly.
[eluser]wiredesignz[/eluser]
@Fuzzy, You should not use "View" as a controller class name, sorry about that. (see Reserved Words) It sounds like you should be using Modular Extensions or Matchbox to manage your code. Note: You do not need to use the HMVC components in Modular Extensions but it does allow you better organization in large applications.
[eluser]Dam1an[/eluser]
I think the 'not calling a controller function view' thing only applies to PHP4 |
Welcome Guest, Not a member yet? Register Sign In |