1

I have a controller Export that extends CI_Controller and another controller called Magento_Attribute_Set that extends CI_Controller too.

I need to call export_attributes() function from Magento_Attribute_Set within Export controller.

I have read similar questions here but they do not make sense to me and I have never worked with codeigniter framework before.

I would really appreciate if someone can guide me please.

gen_Eric
  • 223,194
  • 41
  • 299
  • 337
user4676307
  • 409
  • 8
  • 22

1 Answers1

1

If you need to call a function from one controller in another, that means your code is not organized correctly.

You cannot (at least without dirty hacks) call/load a controller from another one.

What you should do is move the export_attributes() elsewhere, somewhere both controllers can read it. Consider a library or a helper, depending on what the function does.

gen_Eric
  • 223,194
  • 41
  • 299
  • 337