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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:10:47+00:00 2026-05-22T18:10:47+00:00

I have a home controller with an index action that displays a set of

  • 0

I have a home controller with an index action that displays a set of featured products. However, the products are managed through a product controller including a proprietary model and views.

How do I access product information from within the index action in the home controller? Instancing product won’t work as the class isn’t loaded at runtime and CodeIgniter doesn’t provide a way to dynamically load controllers. Putting the product class into a library file doesn’t really work, either.

To be precise, I need the product views (filled with data processed by the product controller) inserted in the index view. I’m running CodeIgniter 2.0.2.

  • 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-05-22T18:10:47+00:00Added an answer on May 22, 2026 at 6:10 pm

    If you’re interested, there’s a well-established package out there that you can add to your Codeigniter project that will handle this:

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

    Modular Extensions makes the CodeIgniter PHP framework modular. Modules are groups of independent components, typically model, controller and view, arranged in an application modules sub-directory, that can be dropped into other CodeIgniter applications.

    OK, so the big change is that now you’d be using a modular structure – but to me this is desirable. I have used CI for about 3 years now, and can’t imagine life without Modular Extensions.

    Now, here’s the part that deals with directly calling controllers for rendering view partials:

    // Using a Module as a view partial from within a view is as easy as writing:
    <?php echo modules::run('module/controller/method', $param1, $params2); ?>
    

    That’s all there is to it. I typically use this for loading little "widgets" like:

    • Event calendars
    • List of latest news articles
    • Newsletter signup forms
    • Polls

    Typically I build a "widget" controller for each module and use it only for this purpose.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following route defined routes.MapRoute( ItemName, {controller}/{action}/{projectName}/{name}, new { controller = Home,
I have parent view that also renders sub-controller action using RenderAction() (that returns a
I have one area Area1 with controller Home and it's Index method. I also
I have area and in that area I have Home/Index that contains Authorize attribute.
I have a HomeController with an Index action that shows the Index.aspx view. It
I want to redirect the Index action of the Home controller to another controller's
I have a home project that really needs to be in Source Control. I
I have folder home/admin. In this folder there is index.php. When i access to
I have a home-grown HTTPS server that serves up simple files (it's embedded within
I have a home-screen widget that has an icon that starts/so pose to bring

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.