CodeIgniter Forums
Problems in establishing default controller using HMVC approach - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problems in establishing default controller using HMVC approach (/showthread.php?tid=59714)



Problems in establishing default controller using HMVC approach - El Forum - 11-08-2013

[eluser]rochellecanale14[/eluser]
Hello guys, I have a problem creating a simple display page using HMVC approach. Before I try to run an example and it is working but after I created my own example I can't make it work. Here's my paths

Controller:
Code:
hmvc/application/modules/category/controllers/category_controller.php

For Views:
Code:
hmvc/application/modules/category/views/index.tpl

Code for Controller:

Code:
<?php

class Category_Controller extends CI_Controller{

  public function __construct(){
   parent::__construct();
  }
  
  public function index(){
                       $title = "Wlecome"
   $this->smartylib->assign('title',$title);
   $this->smartylib->display("index.tpl");
  }

}

?>

For View:

Code:
<html>
<head>
  <title>{$title}</title>
</head>
<body>
</body>
</html>

Route directory is:

Code:
hmvc/application/config/routes.php

My routes code:

Code:
$route['default_controller'] = "category_controller";
$route['404_override'] = '';

My output for this is: 404 Page Not Found





Problems in establishing default controller using HMVC approach - El Forum - 11-08-2013

[eluser]noideawhattotypehere[/eluser]
If you use wideresignz HMVC your controller should extend MX_Controller, not CI_~


Problems in establishing default controller using HMVC approach - El Forum - 11-10-2013

[eluser]rochellecanale14[/eluser]
Ok. But in my model? is it the same as Controller? Do I need to create a model folder inside modules?