Welcome Guest, Not a member yet? Register   Sign In
how many levels of subfolders are supported ?
#1

[eluser]EugeneS[/eluser]
any one knows how many levels of controller subfolders are supported ?

i mean next

lets imagine i have folder structure: application/controllers/admin

inside admin folder i have some controller for example "users"
i can reach it like

http://localhost/admin/users/

can i add another folder into the "admin" folder and then reach the controller inside it smth like:
folder structure: application/controllers/admin/aaaa
inside folder "aaaa" will be some controller "aaaacontroller"

can i reach it through the url like this one or not: http://localhost/admin/aaaa/aaaacontroller/


i cant, but no sure should this way work or not, or only one level of the controller subfolders is supported.
#2

[eluser]Rick Jolly[/eluser]
Yes, only one subfolder is supported. There is at least one user contribution to support unlimited nested subfolders. I think modular separation via Matchbox is a better solution though. That way your related views, libaries, etc. are closer.
#3

[eluser]Michael Wales[/eluser]
Second time this question has been asked today.

Go-Go Gadget Search Box!
#4

[eluser]gtech[/eluser]
Talk about déjà vous Smile
#5

[eluser]EugeneS[/eluser]
[quote author="Rick Jolly" date="1196208531"]Yes, only one subfolder is supported. There is at least one user contribution to support unlimited nested subfolders. I think modular separation via Matchbox is a better solution though. That way your related views, libaries, etc. are closer.[/quote]

up to me 1 level of inclusions enough, but i'm doing now user management class with the different levels of permissions which i gonna use in all my applications so wanna do it quite universal Smile
#6

[eluser]EugeneS[/eluser]
[quote author="walesmd" date="1196210426"]Second time this question has been asked today.

Go-Go Gadget Search Box![/quote]

if so we have to ask this functionality in nearest CI release Smile more over solution is already done Smile
#7

[eluser]AtlantixMedia[/eluser]
I have the following structure:

admin/main
admin/config/configview

where admin is a folder, main is a controller, config is another controller, and configview is a function

main.php
Code:
<?php
include(APPPATH . 'controllers/access/adm.php');

class Main extends Adm {

    var $varsView = array();
    
    //===============================================
    function Main()
    //===============================================
    {
        parent::Adm();
    
    }

    //===============================================
    function Index()
    //===============================================    
    {
    
    
    }


        
}
?>

config.php
Code:
<?php
include(APPPATH . 'controllers/admin/main.php');

class Config extends Main {

    var $varsView = array();
    
    //===============================================
    function Config()
    //===============================================
    {
        parent::Main();
    }

    //===============================================
    function ConfigView()
    //===============================================    
    {
        //do something
    }

}
?>

can someone tell me why I get a 404 error page when I try to access admin/config/configview whereas everything works ok when I access admin/main? also, I use the same structure elsewhere in my application and everything works ok. thanks
#8

[eluser]Craig A Rodway[/eluser]
I don't understand why you are including other controllers directly in those controllers - I'm not sure that is the 'supported' method in CI or how you're extending them the way you are, but I suspect that is why. Normal controllers should extend Controller.

http://ellislab.com/codeigniter/user-gui...llers.html
#9

[eluser]AtlantixMedia[/eluser]
as I said, I use exactly the same method in other parts of the application and it works great.

Adm extends Controller
Main extends Adm
Config extends Main

Adm takes care of access level checks (permissions, etc)
Main hold several common functions used by the Admin section and displays the admin main page
Config takes care of specific configuration functions

also, I get the same 404 error if Config extends Controller
#10

[eluser]AtlantixMedia[/eluser]
forget about it. I fixed it. I did not delete the older version of admin.php which happened to have a function named config in it. so CI was reading that file instead of the one in the admin folder. it works as it should now.

thanks anyway




Theme © iAndrew 2016 - Forum software by © MyBB