- Posts: 21
- Thank you received: 4
Ask the community, share ideas, and connect with other LimeSurvey users!
<?php class HelloWorld extends \ls\pluginmanager\PluginBase{ static protected $description = 'test 4'; static protected $name = 'Hello World'; public function init() { $this->subscribe('BeforeQuestionRender'); } public function beforeQuestionRender(){ $this->getEvent()->set('questionhelp', 'Hello World'); } } ?>
codelogic wrote: - What keys events have at there disposal or where in the source code is a good place to find what keys an event talks to? (This is based of the assumption that one uses hashmap manipulations to get things done in plugins).
DenisChenu wrote: Hi,
Quickliy look at your plugin : seems OK . Did you activate it ?
It's in directory HelloWorld and file name is HelloWorld.php (plugins/HelloWorld/HelloWorld.php)
Start with a die("Hello world") to track down where you are.
PS: this one git.framasoft.org/SondagePro-LimeSurvey-...cessibility.php#L432 does the job.
Right , must be in manual .... due to mediawik the title are capitalized ... in the manual ...codelogic wrote: Last night I found that I capitalized the first letter of the event. :pinch: so the correct way would be as follows
$this->subscribe('beforeQuestionRender');
Die is really the bad way . You can use tracevar() or Yii trace system too.codelogic wrote: Thanks for the die() trick I will use that in the future. I appreciate the pointer on where to look in the code.
Go! go ! for a forum post !codelogic wrote: I'm going to type up a hello world intro for plugins should I post it on a personal BLOG or can you guys use it for the lime survey website?
DenisChenu wrote: Go! go ! for a forum post !
ANd you can put your forum post at www.limesurvey.org/manual/Available_third_party_plugins (maybe need a demo plugin sub title).
Mazi wrote: Thanks for sharing your explanations to help others. Since most users start looking at the available documentation at the Limesurvey manual, can you please add the "Hello World" details at www.limesurvey.org/manual/Plugins ?
Just ping me if you need help with this but it would be very helpful and a good start for others.
Thanks!