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

前端 未结 5 716
有刺的猬
有刺的猬 2020-12-02 17:26

In a controller, what is the most appropriate way to call the action of another controller and also pass an array as parameter?

I know that you can use requestAction

5条回答
  •  鱼传尺愫
    2020-12-02 17:51

    CakePHP 2.X:

    constructClasses();
    
            //Call a method of Posts passing a parameter
            $Posts->aMethod($parameter);
        }
    }
    

提交回复
热议问题