Welcome Guest, Not a member yet? Register   Sign In
Problems in establishing default controller using HMVC approach
#1

[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


#2

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

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




Theme © iAndrew 2016 - Forum software by © MyBB