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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:48:52+00:00 2026-06-16T18:48:52+00:00

I asked this question previously : Codeigniter Class Inheritance between modules (wiredesigns) I accepted

  • 0

I asked this question previously : Codeigniter Class Inheritance between modules (wiredesigns)

I accepted an answer to that question which provided a way of doing what I want by extending a custom controller in application/core. This approach seemed sensible and offered the added benefit of allowing both modules to function independently.

However, Having thought about it, I am not sure this is the best approach for this situation because My Products controller will require almost all of the functionality of the item controller so this approach will leave my item controller almost empty – I’m not sure I like this.

QUESTION 1

Although I may still go with the approach previously suggested, I would like to know if there is a way to extend classes between modules so that I can weigh up the two options (see original question below)

QUESTION 2

Additionally, I think I should be able to re-use much of my model class, I can see that I would be able to do this using the MY_Model in app/core approach. But…

a) Is there a way to directly access another modules models?

b) Could I extend my models between modules in a similar way to question 1 for controllers

PREVIOUS QUESTION

My CI2 app is using the wiredesigns modular layout.

I have a two modules called item and product in a a folder called modules like so:

/application
    /modules
        /item
        /product

In Item I have a controller called item which starts like this.

class Item extends MX_Controller
{
    //code here
}

What do I need to do to make my products controller extend my item controller in a different module

  • 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-16T18:48:53+00:00Added an answer on June 16, 2026 at 6:48 pm

    The correct answer here is:

    Don’t

    Why are you trying to do this? Place your logic into a library or some sort of shared file and implement a call to that library instead.

    You could make Item an abstract class in your application/libraries folder and the autoloader built into HMVC will automatically load it. There is no reason this needs to be in a module, and it definitely doesn’t need to be a controller.

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

Sidebar

Related Questions

Previously I had asked this question and accepted the answer because it worked in
I previously asked this question, which was answered, but someone gave a suggestion that
I have previously asked this question and since I already accepted an answer, I
This is an edited version of a question that I had previously asked (and
I have a problem similar to this question which was previously asked but my
Previously I asked this question and got back this BeautifulSoup example code, which after
This question was previously asked in scala-user mailing-list without a confirmed answer. scala> val
I previously asked this question in the Delphi XE2 timeframe, and the answer then
I know this question was asked previously and the reply was to override onPrepareContextMenu()/onCreateContextMenu().
This is an extension of a question I previously asked here . Long story

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.