Skip to content

Developing plugins

Code generator

Want to jumpstart ECA plugin development? Try the eca_development sub-module (not for use on production sites):

1
2
3
4
5
drush en eca_development

drush gen eca-event     # Generates files for ECA event support.  
drush gen eca-condition # Generates an ECA condition plugin.  
drush gen eca-action    # Generates an ECA action plugin.

Developer guidelines

Let's collect guidelines for developers, so that the code structure becomes more clear and stays consistant.

  • Default values in plugins: they can be defined in ::defaultConfiguration() which will pre-set the fields in the UI. But since the user could remove those values, it still may be possible that the ::access and ::execute methods could find empty values, eventhough the default already had a value in them. Therefore, configuration values need to be checked in all use cases and set to default if expectation isn't met.