HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/apklausos/plugins/Demo/ShowResponse/ShowResponse.php
<?php
class ShowResponse extends PluginBase {
    protected $storage = 'DbStorage';    
    static protected $description = 'Demo: handle a survey response';
    static protected $name = 'Show response';
    
    public function init()
    {
        /**
         * Here you should handle subscribing to the events your plugin will handle
         */
        $this->subscribe('afterSurveyComplete', 'showTheResponse');
    }
    
    /*
     * Below are the actual methods that handle events
     */
    public function showTheResponse() 
    {
        $event      = $this->getEvent();
        $surveyId   = $event->get('surveyId');
        $responseId = $event->get('responseId');
        $response   = $this->pluginManager->getAPI()->getResponse($surveyId, $responseId);
        
        $event->getContent($this)
              ->addContent('You response was:<br/><pre>' . print_r($response, true) . '</pre>');
    }
    
    
}