• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modular Extensions - HMVC version 5.4

@darkhouse, You could try using a catchall route sending everything to your default controller and use the _remap() method to sort out the URL.
$route['(.*)'] = $route['default_controller'].'$1';

hi `m new to hmvc pattern.. could u guide me how to integrate it with CI2.0

Did you read the article on HMVC in the WIKI? That explains how to set it up and use it.



thnx for ur reply :-)
actually i was converting my application to hmvc. In my application i had a small tweak in MY_router.php . it made me to stumble upon the hmvc installation. now i altered my old my_router.php compatible with HMVC extension. now everything works like charm. Thnx for ur assist :-)

@wiredesignz: Yeah, I really wanted to stay away from that. I don't want to have to add manual routing for every controller each time.

I ended up going through the code and adding a quick fix that seems to be working very well. The only issue is that when you have an update, I'll have to modify the code again. Here's what I did.

In application/third_party/MX/Modules.php on roughly line 92, in the load method, I changed to
list($class) = CI::$APP->router->locate($segments, true);

In application/third_party/MX/Router.php on roughly line 63, the locate method, I changed to
public function locate($segments, $get_module=false) {

Then still in that file, on roughly line 79, I changed to
list($module, $directory, $controller) = array_pad($segments, 3, NULL);
if($get_module !== false){
    foreach (Modules::$locations as $location => $offset) {

And added the corresponding close bracket on roughly line 114, right after the foreach closes.

And finally, in application/core/MY_Router.php on roughly lines 32 and 33 I changed to
public function locate($segments, $get_module=false){
    if($located = parent::locate($segments, $get_module)) return $located;

And I believe that's it. The only other thing I'd like to do is make it a config option so that I can turn the feature on an off for different projects, but I'll worry about that later.

Is it possible to extend the lang library? I tried dropping application/libraries/MY_Lang.php with: class MY_Lang extends MX_Lang {... and it did not work. I was following the instructions on the ME site "All MY_ extension libraries should include (require) their equivalent MX library file and extend their equivalent MX_ class".

Looking through the ME code it looks like it never looks for a MY_Lang file, how can I have it search for this first? Can any MX libraries be extended?

drop it in core for ci2.

Also, why when I make a controller that is extended from MX_Controller it will auto-load items in my autoload config but when I extend from CI_Controller it will not?

I am refering to just application/config/autoload.php


when I do that I get the error:

Fatal error: Class 'CI_Controller' not found in D:\Development\intranet_new\system\core\CodeIgniter.php on line 231

@wilso417 ,
did u dropped ur MY_lang file inside the "application\core"

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

Users browsing this thread:
1 Guest(s)

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.