php - Accessing methods from another CakePHP controller, or better alternative! -
I am creating a 'Award' system for my website to encourage a community, the way Overflow badges Site
The site is built in CakePHP, I have created a prize model, controller etc. - currently to determine whether the award is included within the Controller or not.
However, I can not decide the best way to update awards - for example, you make certain comments and receive a prize for it, cron will not be sufficient otherwise otherwise the user Can expect an award on his profile, and unless the cron runs, he does not have one.
I was considering using the requestAction () to call the method to update the awards in the Action Controller, although it did not really fit the MVC design pattern and thought That should be a better way!
If someone is commenting the only way to get a prize, then I just model: override If this is adding a new comment, if so, then make a call on the award model to update the prize.
If there are many verbs which can give rewards, then you can either tap into this model to check this model or modify AppModel
Or maybe I question Do not understand?
Comments
Post a Comment