Access functions across controllers?

How do I access functions from one controller in another one?

You do not. If you need a function across multiple controllers it will need to be placed in a library. I recommend you create a "common" library that allows you to store these functions in. Works best for these types of cases.

If you end up with a few related functions then you should probably create yourself a new library for those functions ... like for example if you have 3-4 functions specifically for date/time manipulation.


Search for HMVC and Wick for this kind of functionality. There are some perfectly valid causes for this behaviour.

[eluser]Derek Allard[/eluser]
Just for clarity, (I'm not sure what you mean by "access" functions) but you can use
class Foo extends Controller {

    function one()

    function two()
        // do something

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.