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>');
    }
}