Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I'm right, you are using Modular Extensions - HMVC. So I've based my answer on the following script : <a href="https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/src/868e97533562e910d8263af22750985d57004baa/third_party/MX/Modules.php?at=default" rel="nofollow">https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/src/868e97533562e910d8263af22750985d57004baa/third_party/MX/Modules.php?at=default</a>.</p> <p>This will only work if you are using PHP 5.3 or above.</p> <ul> <li>Declare every Admin classes inside a namepsace (admin, categories, post) by adding <strong><em>namespace admin;</em></strong> before the class keywork.</li> <li>Create a child class of *third_party/MX/Modules.php* and extend the run and load methods. If extending is not possible, you'll have to replace the methods :/</li> <li>This is not the whole thing, but those simples string operations should be in the load method before the existing logic.</li> <li><p>A module should be run with the following syntax : <strong>*Modules::run('categories\admin/_menu');*</strong></p> <pre><code>$module = 'categories\admin'; if (strpos($module, '\\') !== false) { // Extract namespace $ns = explode('\\', $module); // Get the top level namespace to locate the controller $top_level_ns = reset($ns); // // Remove namespace from module $module = array_pop($ns); // Class location $path = APPPATH . $top_level_ns . '/controllers/' . $module; // It's better to extend the load_file method include_once $path . EXT; // Full class name with namespace, we use explode on $module in case of sub folders $controller = '\\' . implode('\\', $ns) . '\\' . ucfirst(end(explode('/', $module))) . CI::$APP-&gt;config-&gt;item('controller_suffix'); // create and register the new controller $alias = strtolower($controller); self::$registry[$alias] = new $controller($params); var_dump('Full class name: ' . $controller, 'Class path: ' . $path); } </code></pre></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload