Skip to content

Commit beb2554

Browse files
committed
Add module when loading a controller method
1 parent 0edaa5e commit beb2554

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

third_party/HMVC/Loader.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,17 @@ public function controller($uri, $params = array(), $return = FALSE) {
8080
$uri = $module . '/' . $uri;
8181
}
8282
}
83+
84+
// Add module
85+
$this->add_module($module);
8386

84-
return $this->_load_controller($uri, $params, $return);
87+
// Execute the controller method and capture output
88+
$void = $this->_load_controller($uri, $params, $return);
89+
90+
// Remove module
91+
$this->remove_module();
92+
93+
return $void;
8594
}
8695

8796
/**

0 commit comments

Comments
 (0)