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 8065039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:32:52+00:00 2026-06-05T11:32:52+00:00

I have two modules in my installation. Both modules’ controllers pass a variable called

  • 0

I have two modules in my installation. Both modules’ controllers pass a variable called

$data['content']

to their views. Also, the first module’s view runs the second module via

<?php echo Modules::run('module2'); ?>

and after that is supposed to display values from its $data[‘content’] variable. Unfortunately, that’s when the first module’s $data content is substituted with the second module’s $data. This is pretty inconvenient for me, so I would like to know if there is a way to “protect” the $content variables and keep them only within their associated modules?

I would like to avoid renaming $data[‘content’] if possible. I’ve found a not-so-perfect solution in using

$data(__CLASS__)

but I am curious if it is possible not to change $data[‘content’].

  • 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-05T11:32:53+00:00Added an answer on June 5, 2026 at 11:32 am
    class Some extends MX_Controller{
    
        public function __construct(){parent::__construct();}
    
        public function index(){
            $this->load->view('template', array( //Primary template
                'content'    =>  'some_index' // index view
            ));
        }
    
        public function _module_1(){
          $this->load->view('module_1_view', array( //Module View : NO primary template
                ''    =>  '' <= no need to load view here, only data
            ));
        }
    
        public function _module_2(){
          $this->load->view('module_2_view', array( //Module View : NO primary template
                ''    =>  '' <= no need to load view here, only data
            ));
        }
    }
    

    –

    template.php

    <html>
      <?php $this->load->view($content); ?>
    </html>
    

    –

    some_index.php

    <html>
    
    //call modules
    <?php echo Modules::run('some/_module_1'); ?>
    
    <?php echo Modules::run('some/_module_2'); ?>
    
    //call module from another class
    <?php echo Modules::run('another_class/_module_1'); ?>
    
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two modules counter: Output is a vector called error_count. lcd: Module to
I have added two modules in my drupal site called.... 1. me alias 2.
I have found two modules that save their module specific settings without using sql
Ok I have two modules, each containing a class, the problem is their classes
I am working on a transliteration tool. I have two modules lexer and translator.
I have two different modules that need access to a single file (One will
I have these two modules : package G1; sub new { my $class =
Am working on some application. However, i have finished two modules which invoke the
I have made two kernel modules for client and server which are transmitting the
In my code base I find that two modules have structures with the same

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.