In my application, i have many methods that my controllers use commonly. At first i copied them to controllers, then i found out that i must put them in AppController. So i. reach those methods from derived controllers by "$this->commonmethod"
The methods that i put into AppController creates different types of data, so i need to put them to 4-5 different tables in my database. Most of the tables don't have a relation between each other.
But most of my controllers will use that tables to fetch related data for them.
(I checked the examples in cookbook, there are examples about Blogging, category and tags. Where tables have relation between them)
- Should i put my common controller code into a Plugin or Component? Or what would be the decision criteria?
- Is it possible to use multiple database tables from a controller or a component?
- Do Datasources or behaviours are suitable for this case.
Thank you in advance