简体   繁体   中英

hmvc in codeigniter cannot access modules

Iam trying to switch to hmvc in codeigniter. I will explain my issue from scratch itself. First I downloaded Codeignter 3.0 version from http://www.codeigniter.com/download and when I check my browser it is showing the welcome message of CI. Now to add hmvc structure I downloaded the hmvc modular extension from https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/downloads . And placed the core and third party modules inside my CI folder. Then I created a Folder inside the application folder and named it as modules. Within modules I created a folder say test. I have a controller folder which contain test.php.

class Test extends MY_Controller {


public function index()
{
    echo "hey my first module is ready";
 }
}

But when i call the module in the url like localhost/index.php/test i got a page not found error. Am i missing any configuration? I got all other controller working well before i switched to hmvc. How can i fix this. Thanks in advance.

Do you forget this piece of code in your config file?

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

Do you created your own Controller? Cause you extends MY_Controller .

If not, extend CI_Controller or MX_Controller

For more information read the documentation at wiredesignz's HMVC for Codeigniter

Kind regards

Try to follow this tutorial.Here you will get ready to use HMVC folder. http://www.darwinbiler.com/ready-to-use-codeigniter-modular-extensions-hmvc/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM