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.

1
  • Why not put it in the parent controller (CI_Controller) ? Commented Sep 4, 2015 at 13:47

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.