Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7875485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:59:22+00:00 2026-06-03T02:59:22+00:00

i have this testing code which am working with .. i have a module

  • 0

i have this testing code which am working with ..
i have a module called ms and and another one called test
the test controller code is :

<?php
class Test extends MX_Controller {

    public function __construct()
    {
        parent::__construct();
        $this->template->title($this->config->item('site_name','app'));
    }

    public function index()
    {
        $this->template->build('index');
    }
}

and the code inside ms is :

<?php
//ms module
class Msrofi extends MX_Controller {

    public function __construct()
    {
        parent::__construct();
        $this->template->title($this->config->item('site_name','app'));
    }

    public function index()
    {
        $t = Modules::run('test/test/index');
        var_dump($t);
        $this->template->build('index_message');
    }
}

the problem is that the build function inside test is trying to find the index view file inside the ms views folder not the test views folder ..
i checked the $this->_module and it gave me the ms module name ..
any one know how to fix that ??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:59:23+00:00Added an answer on June 3, 2026 at 2:59 am

    Since the test module is being called in the context of the ms one, $this->template->build() is looking for a view file in the ms module. The same way you can load models and libraries cross-module, you would have to do this for your view path as well:

    class Test extends MX_Controller {
    
        public function index()
        {
            // This path works only from the "test" module
            // $this->template->build('index');
    
            // This path works from any module
            $this->template->build('test/index');
        }
    }
    

    It’s a little annoying maybe to have to explicitly call the module path in the module itself, but cross-module dependency defeat some of the goals of modularity in the first place.

    A quick aside: Modules::run() output not returned, but directly echoed, so you can’t assign it to a variable or print_r/var_dump it without using an output buffer:

    ob_start();
    Modules::run('test/test/index');
    $t = ob_get_clean();
    var_dump($t);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATED CODE: Now, I have this code: <h2>Testing</h2> <input type=checkbox name=fruit1 id=id1 class=box>Banana<br /><br
I have this thread. Earlier, I was testing the code without the thread and
I get this error, while I'm testing the code below: You have an error
I ran into this situation today. I have an object which I'm testing for
This is a MVC 3 project. Just for testing, I have public class MyRoleProvider
I have a little application which is working fine when testing is on localhost.
For testing purposes I have this shell script #!/bin/bash echo $$ find / >/dev/null
I am testing this sample on version 13 of android (3.2) and I have
I'm wondering how to go about testing this. I have a method that takes
Hi I'm testing some CRUD operations in Nhibernate. I have 3 tests in this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.