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

  • Home
  • SEARCH
  • 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 9195449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:37:48+00:00 2026-06-17T21:37:48+00:00

I’m using the HMVC modular separation for my Codeigniter application and trying to figure

  • 0

I’m using the HMVC modular separation for my Codeigniter application and trying to figure out how I can attempt this with my template I have set up. There could possibly be a better way to handle this and I’m not sure of it but if anyone can suggest one I’d be all ears. This is my current file system.
Supr as noted as a a folder below is the current theme template I am using.

Inside each module controller exists a variable called $view_file. This is the variable this is passed to the body content view page and tells it which view file to display inside my content wrapper in my control panel.

What I need to figure out is how to add on a file_exists function to the if statement so that it looks to see if the value for the variable can see if that file exists but not sure how to accomplish this with this HMVC module separation framework. The reason why I need help understanding how to do this is because I don’t know how to have it know which module view to look into.

I have also included my code for the body content view which contains an if statement to find out which file it needs to load.

https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc

application/
    modules/
        blog/
            controllers/
                blog.php
            models/
                blog_model.php
            views/
                blog_view.php
        dashboard/
            controllers/
                dashboard.php
            models/
                dashboard_model.php
            views/
                dashboard_view.php
    views/
        supr/
            cpanel/
                header.php
                footer.php
                body_content.php

<!--Body content-->
<div id="content" class="clearfix">
    <div class="contentwrapper"><!--Content wrapper-->

    <?php 

    if ((empty($view_file)) || (!isset($view_file)) || (trim($view_file) == '')) //add file exists to if statement for module view file being requested
    {
        $this->load->view('supr/body_unknown_view');
    }
    else
    {
        $this->load->view('supr/cpanel/pages/' . $view_file);  // Change to module speration view file 
    }

    ?>
</div><!-- End contentwrapper -->
</div><!-- End #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-17T21:37:49+00:00Added an answer on June 17, 2026 at 9:37 pm

    here is one way you can use for body content of view take advantage of OOP extend your controllers with MY_Controller create MY_Controller class under application core.

    class MY_Controller extends MX_Controller { 
         // not using Modular extentions then extend with CI_Controller
    
        function __construct(){
              parent::__construct;
        }
    
        function build($view=null,$data=array()){
    
              $load_view = 'supr/body_unknown_view';
    
              if(strlen($view))
              {
                   $load_view = 'supr/cpanel/pages/' . $view;
              }
    
            $body = $this->load->view($load_view,$data,TRUE);
    
            $this->load->view('supr/cpanel/body_content',array('body'=>$body));
    
        }
    
    }
    
    //blog controller
    class blog extends MY_Controller { 
    
    
            function __construct(){
                  parent::__construct;
            }
    
            function index(){
               //anydata
               $data['blog_content'] = 'blog content';
               $this->build('blog_view',$data);
            }
    
        }
    
    <!--Body content-->
    <div id="content" class="clearfix">
        <div class="contentwrapper"><!--Content wrapper-->
    
        <?php echo $body; ?>
    
    </div><!-- End contentwrapper -->
    </div><!-- End #content -->
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I know there's a lot of other questions out there that deal with 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.