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

BeforeCloseHtml

From LimeSurvey Manual

 Hint: This features is available starting in version 2.62.0


NB: Version 2.60.0 is not the same version as 2.6. 2.6 is the new name for 2.06.


When

This event is fired before the HTML document is closed.


Input

The event receives the following information:

Name Type Description
surveyId int or null surveyId will be null in front-end pages that have no survey, e.g. the survey list.


Possible output

The following information can be set in the event:

Name Type Description
html string HTML that will be put last in the document.


Example

public function beforeCloseHtml()
{   
    $event = $this->getEvent();
    $surveyId = $event->get('surveyId');
    if (empty($surveyId)) {
        // We are on survey list
    }
    else {
        // Any other front-end page
        $event->set('html', '<div class="only-visible-when-we-have-survey-id"></div>');
    }
}