• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controllers in Unlimited Nested Folders

#21
[eluser]Robson Tenório[/eluser]
if you try a path that not exists, CI will redirect you to default controller.
To avoid this edit the code:


Code:
...
        // quick an easy forced reindexing
        $segments = array_values($segments);
    
              //BEGIN INSERT
        if ($segments == NULL)
            show_error('Path not found');            
          //END INSERT
        
        // put the entire directory path back into the segment as the first
        $dir = trim($this->directory, '/');
...

#22
[eluser]adamp1[/eluser]
This sounds a great idea, I have wanted to do this and couldn't understand why it wasn't implemented in CI.

Do you think it might get put into CI1.5.5 somehow? It of course would need testing but since it doesn't cut back on functionality only adding, it should be backward compatible.

#23
[eluser]Robson Tenório[/eluser]
I think so Wink
That was an update to code proposed on thread and it solved a little problem.

#24
[eluser]Shpigford[/eluser]
So pardon my ignorance here...but how exactly do I implement this code?

#25
[eluser]Shpigford[/eluser]
Somebody...anybody?

#26
[eluser]xwero[/eluser]
paste the two code snippets in files with the names of the classes in the application/libraries directory

#27
[eluser]Shpigford[/eluser]
Two snippets? I only see one in the main post.

#28
[eluser]xwero[/eluser]
there is one on this page, thread n°18

#29
[eluser]proman[/eluser]
Hi,

I was using this feature in version 154 with success and exploring 2 levels sub-folder in my CI application. Unfortunately, today I tried to upgrade to version 160 and my second level stop working but the first level still working.

Someone knows what happened?

Thanks in advance.

#30
[eluser]proman[/eluser]
Hi again,

Its look like we only have to change the name of the method from "_validate_segments" to "_validate_request" in the Router extension. It start working like before. See the code bellow.

Code:
function _validate_request($segments) {
   return parent::_validate_request($this->_pluck_directory($segments));
}

I don't know why they changed the name but they must have a reason.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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