XF 2.2 ControllerPlugin

Robert9

Well-known member
Let's watch the RM!
We have overview, we have cats, we have things like: your resources, new resources

Main classes are p/c/resourceitems and cats

resourceitems cares for overview and detailed pages
cats care for cats

both use the controllerPlugin to fetch cats and lists of resources

My question is: is this controllerPlugin something special?
Is there any difference between service/finder/repo and controllerPlugin?

service we use for add/edit/delete/prepare
finder we use for often-used searches
repos are for different jobs or as preparing something for finder

But why we have this controllerPlugin?
When we add an icon, for example, it is to call a second script while we wait to finish the form/first script?

But why is it used for collecting cats and items in the RM?

If there would be an RM without any cats, just with the overview, we would not use it?
Instead, move the code to the p/c/?

I repeat it:
Imagine an RM without cats; we have overview, we have filters; would we use the ControllerPlugin at least for the filters?
Or move everything to the main class?
 
It's just an abstraction like any other, but tailored towards controllers. It allows abstracting (mostly) duplicate controller code. If you aren't doing something more than once or twice, you aren't gonna need it. Otherwise you can create a controller plugin so you don't repeat yourself.
 
Back
Top Bottom