[J4] Services vs helpers?

18 views
Skip to first unread message

MarkRS

unread,
May 9, 2022, 7:57:04 AM5/9/22
to Joomla! General Development
What's the difference between these two?

I can see (I think) that services are used with/via/by DI and helpers aren't, is there anything else?

Peter Tuson

unread,
May 12, 2022, 1:37:11 PM5/12/22
to Joomla! General Development
Hello again Mark,

I my mind services are methods that help the component interact with the Joomla 4 services.

I use the helpers to interact with things that aren't directly part of Joomla, preparing information for controllers and models.

Examples are:
  • Getting information from external databases
  • Getting information from files.
I also use them for preparing information that is used in common with other controllers and models.

I also use them to support plugins when the are using similar information to the component.

I hope that helps.

Regards,

Peter.
Reply all
Reply to author
Forward
0 new messages