I have a global object in my main controllers that I need to pass to a plugin controller, how do I achieve this and resolve the scope?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you speaking about global object placed in app_controller.php of your application, then it’s very easy, because all plugins extend AppController class. Basically what would be your code:
Then because your plugin’s AppControler extends applications’s AppController you can access it in all plugin’s controllers functions. For example:
Hope this is what you asked.