x

Main chapters

  1. LimeSurvey Cloud vs LimeSurvey CE
  2. LimeSurvey Cloud - Quick start guide
  3. LimeSurvey CE - Installation
  4. How to design a good survey (Guide)
  5. Getting started
  6. LimeSurvey configuration
  7. Introduction - Surveys
  8. View survey settings
  9. View survey menu
  10. View survey structure
  11. Introduction - Questions
  12. Introduction - Question Groups
  13. Introduction - Surveys - Management
  14. Survey toolbar options
  15. Multilingual survey
  16. Quick start guide - ExpressionScript
  17. Advanced features
  18. General FAQ
  19. Troubleshooting
  20. Workarounds
  21. License
  22. Version change log
  23. Plugins - Advanced
 Actions

ExpressionManagerStart

From LimeSurvey Manual

 Hint: This feature is available starting in version 4.0.0


Usage

This event is triggered when the Expression Script engine builds its list of available functions. It allows a plugin to register its own custom Expression Manager function(s).

Input

None.

Possible output

  • functions: array of new functions to add to the expression manager.
  • packages: array of name => definition pairs, registered via Yii's CClientScript package mechanism, added as a dependency of the expression manager's own JavaScript package.

Function definition

Each function is defined as a zero-indexed array containing, in order:

  • PHP callable to execute — can use a fully qualified class name, e.g. \Namespace\Class::method.
  • JavaScript function name, or null for a static function (one with no live JavaScript evaluation).
  • Short description, shown in the administration GUI.
  • Usage syntax, shown in the administration GUI.
  • Help URL.
  • Number of arguments — trailing elements of the array give the allowed argument count(s):
    • 1, 2: 1 or 2 arguments
    • 1, 2, 3, 4: 1, 2, 3 or 4 arguments
    • 2, 4: 2 or 4 arguments
    • A negative value means "at least N arguments, any number above that": -1 means any number of arguments (minimum 0), -2 means at least 1 argument, -3 means at least 2, and so on (minimum = abs(value + 1)). Only the first value is used in this case — no other trailing elements are read.

Example