Вопрос

I've some struggling with the HMVC module of Wiredesignz

The point is: Everybody seems to be able to use sub-dirs with HMVC, (for example here: here), by adding this to the config.php file found in /application/config/config.php:

$config['modules_locations'] = array(
    APPPATH.'modules/' => '../modules/',
    APPPATH.'modules/' => '../modules/test',
);

But, it doesn't work for me. It seems this line is completely ignored.

What i've tried:

made the following files:

-modules
    -- foo
    -- -- controllers
    -- -- -- test.php

    -- test
    -- -- bar
    -- -- -- controllers
    -- -- -- -- baz.php

foo/test works, even if I remove the complete $config['modules_locations'] line. But test/bar/baz doesn't.

The manpage of Wiredesignz says:

The Modules::$locations array may be set in the application/config.php file.

It seems like a typo (application/config/config.php is more logically), but I've even tried that (but no luck).

What's going wrong here?

Tnx :)

edit: by 'it doesn't work' I mean I get a 404.

Это было полезно?

Решение

Unless there are according to many forums about this topic, there is just one correct way to set up your /application/config.php file:

$config['modules_locations'] = array(
    APPPATH.'modules/' => '../modules/',
    APPPATH.'modules/test/' => '../modules/test/',
);

After setting that, I was be able to access the controller baz from the example on domain.com/index.php/baz (not /test/baz, thats also possible by adding a route for it.)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top