Note that there are some explanatory texts on larger screens.

plurals
  1. POTwo or more loaded controllers with the same name "admin" are not working in HMVC in CodeIgniter
    primarykey
    data
    text
    <p>The structure looks like this:</p> <pre><code>modules admin controllers/ admin.php models/ admin_model.php views/ admin/ index.php categories/ controllers/ admin.php categories.php models/ categories_model.php views/ admin/ index.php menu.php frontpage.php posts/ controllers/ admin.php posts.php models/ posts_model.php views/ admin/ index.php menu.php frontpage.php </code></pre> <p>The admin controller looks like:</p> <pre><code>class Admin extends Backend_Controller { function __construct() { parent::__construct(); $this-&gt;load-&gt;model('categories_model'); } public function index() { // index stuff } public function _menu() { $this-&gt;load-&gt;view('categories/admin/menu'); } } </code></pre> <p>And when I am calling it from another module view like this:</p> <pre><code>&lt;?php echo Modules::run('categories/admin/_menu'); ?&gt; </code></pre> <p>it doesn't work ;(</p> <p>However this works:</p> <pre><code>&lt;?php echo Modules::run('categories/categories'); ?&gt; </code></pre> <p>So my problem is how to load the controller with a name <strong>admin</strong> and not the name as the module's name and the method "<strong>menu</strong>"</p> <p>Any idea how could I make it work in CodeIgniter?</p> <p><strong>EDIT:</strong></p> <p><strong>I have found out that if I change my controller name from "admin" to something else e.g. "blablacontroller" it magically starts working.</strong> </p> <p><strong>I have already another module called "admin" so could this be a problem?</strong></p>
    singulars
    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.
 

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