Welcome Guest, Not a member yet? Register   Sign In
Can Codeigniter hmvc supports multiple controllers from a module?
#1

Hello All. I am new to this forum and new to Codeigniter Hmvc as well.  
I have a question. Can this hmvc supports calling multiple controller functions from single controllers folder. For example I have modules folder . Under modules I have controllers folder and views folder. In controllers folder I have created two controller functions. 

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

/**
* HODController
*/
class Hod extends MY_Controller
{
    public function 
__construct()
    {
        
parent::__construct();
        
    }
    public function 
index()
    {
         
$this->load->view('welcome');
    }
    public function 
sayHi()
    {
        
$this->load->view('sayhi');
    }




PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

/**
* HOD1Controller
*/
class Hod1 extends MY_Controller
{
    public function 
__construct()
    {
        
parent::__construct();
        
    }
    public function 
index()
    {
        
$this->load->view('welcome');
    }

    public function 
sayhi()
    {
        
$this->load->view('sayhi');
    }


http://localhost/adeptra_hmvc/index.php/hod/sayhi - this is working
http://localhost/adeptra_hmvc/index.php/hod1/saybye - this says 404 - page not found error. So is it possible to work with calling multiple controllers from a module in hmvc?
Thanks ,
Ajay K.
Reply
#2

PHP Code:
// add to your ./application/config/config.php file
$config['modules_locations'] = array(
 
   APPPATH.'modules/' => '../modules/',
); 

Change the '../modules/' to where your modules folder is located.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB