BeforeCloseHtml: Difference between revisions
From LimeSurvey Manual
Created page with "{{FeatureStarting|2.60.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 clo..." |
No edit summary |
||
Line 36: | Line 36: | ||
public function beforeCloseHtml() | public function beforeCloseHtml() | ||
{ | { | ||
$event = $this->getEvent(); | $event = $this->getEvent(); | ||
$surveyId = $event->get('surveyId'); | $surveyId = $event->get('surveyId'); |
Revision as of 16:50, 20 January 2017
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
}
}