How to access function located in package controller?

Permalink
Hello,
excuse me if this was tackled before, but I just can't seem to find the answer...
I have a package and the following file: /packages/file_organizer/controllers/dashboard/file_organizer/organize.php
In the file I have the public function orgByType() which is working perfectly when triggered from the dashboard.
Then I've extended the members.php controller in /concrete/controllers and there I want to use the orgByType() function, so I tried all kinds of variations of:
$org = Loader::controller("packages/file_organizer/controllers/dashboard/file_organizer/organize");
$org->orgByType();

BUT nothing seems to work for me?
Any tips&tricks will be greatly appreciated...

Finally, if this is not possible should I move the orgByType() in a model within the package and then try to load the model instead?

Thank you in advance!

serdica
 
serdica replied on at Permalink Best Answer Reply
serdica
Finally I have decided to move the function in a helper, which can be loaded from the package controller and from the extended version of the members controller.
Well, I had to put a few if-elses to figure out from where the actual load was triggered.
So, the code in project/controllers/members.php that is loading the function became this:
$obt = Loader::helper('organize', 'file_organizer');
  $obt -> organizeByType();


Hope, someday this gives a hint to somebody...