CakePHP: best way to call an action of another controller with array as parameter?

I would not advice to use the method requestAction but rather import, and instantiate the needed controller. CakePHP doc says about requestAction that: “It is rarely appropriate to use in a controller or model” http://book.cakephp.org/view/434/requestAction Once you imported and loaded the controller you can call any method of this controller with its parameters. <?php //Import … Read more

Singleton with parameters

Singleton is ugly but… public class Singleton { private static Singleton _instance = null; private static Object _mutex = new Object(); private Singleton(object arg1, object arg2) { // whatever } public static Singleton GetInstance(object arg1, object arg2) { if (_instance == null) { lock (_mutex) // now I can claim some form of thread safety… … Read more