1

I am planning the development of a joomla system plugin and I need an advice on how to implement it.

This plugin will be triggered in 4 or 5 events, like onBeforeRender, onAfterRender ...

For a better readability and maintenance which is the best approach: - call with include in each event a file with the according task or - include in the main plugin all the code

Appreciate your guidance.

1 Answer 1

5

Plugin development in Joomla is on of the most interesting task and Joomla documentation further makes it more simple and easy going.

Below are some of the reference which you can refer for plugin development help.

Plugin Development

Joomla Events

Creating a Plugin for Joomla

With reference to your second query, well it somewhat depends upon your code. If you think your code is not manageable within a single file then you can separate out it in different files and classes.

But there will not be any issue if you write the complete code in a single file. What you can do to make your code manageable and look systematic is divide your code in functions and call these functions in the event.

2
  • Thanks for your answer. Having separate files implies the need of classes or it's recommended?
    – n.h.
    Mar 17, 2015 at 17:39
  • as such there is no compulsion..if you want to follow oops standard then you can maintain different classes else you can create different files without any class
    – Nick
    Mar 17, 2015 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.