- Posts: 57
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
//In plugin A public function beforeSurveySettings() { $this->event->set("surveysettings.{$this->id}", array( 'name' => get_class($this), 'settings' => array( 'mySurveySetting'=> array( 'type'=>'info', 'content'=>'Something to test')), ), ), )); } public function newSurveySettings() { foreach ($this->event->get('settings') as $name => $value) { $this->set($name, $value, 'Survey', $this->event->get('survey')); } } //In plugin B public function beforeQuestionRender() { $oEvent=$this->getEvent(); $sid = $oEvent->get('surveyId'); $info = $this->get('mySurveySetting', 'Survey', $sid); //This should print "Something to test", but is NULL if called from another plugin var_dump($info); }
No because you are inside plugin B, then you get mySurveySetting of plugin B.//This should print "Something to test", but is NULL if called from another plugin
$oPluginA = new PluginA(); $info = $oPluginA->get('mySurveySetting', 'Survey', $sid);