- Posts: 61
- Thank you received: 3
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
The sequence of events and their early termination
2 years 1 month ago #212403
by alorenc
The sequence of events and their early termination was created by alorenc
- Where can I find a description of the sequence of called events?
- I would like to know if there are any events between boforeControllerAction and afterControllerAction?
- Is it possible to interrupt the execution of an event in such a way that the action following it does not execute?
For example, if I catch the beforeControllerAction event, how can I prevent the action from being triggered after this event?
The topic has been locked.
2 years 1 month ago - 2 years 1 month ago #212408
by alorenc
Replied by alorenc on topic The sequence of events and their early termination
ad 3)
If I use the "die()" function it will work. But I don't think that's good practice in this case. Example:
If I use the "die()" function it will work. But I don't think that's good practice in this case. Example:
Code:
public function init() { $this->subscribe('beforeControllerAction'); } public function beforeControllerAction() { $isPostRequest = $this->api->getRequest()->getIsPostRequest(); if (!$this->ownController && $isPostRequest && 'admin' == $this->event->get('controller') && 'tokens' == $this->event->get('action') && 'importldap' == $this->event->get('subaction')) { //... Here is to run another action from a different controller die(); } }
Last edit: 2 years 1 month ago by alorenc.
The topic has been locked.
- DenisChenu
-
- Away
- LimeSurvey Community Team
-
Less
More
- Posts: 12895
- Thank you received: 2371
2 years 1 month ago #212444
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic The sequence of events and their early termination
1. We try
manual.limesurvey.org/Plugin_events
2. manual.limesurvey.org/BeforeControllerAction , near after : beforeCloseHtml or getPluginTwigPath (not done for this but happen after all action done, just before HTML is produced (in survey))
3. see possible output `run` as false, you can replace any controller by your own or show any message (but this one is outdated : i start to use twig now)
I move this topic to developement
2. manual.limesurvey.org/BeforeControllerAction , near after : beforeCloseHtml or getPluginTwigPath (not done for this but happen after all action done, just before HTML is produced (in survey))
3. see possible output `run` as false, you can replace any controller by your own or show any message (but this one is outdated : i start to use twig now)
I move this topic to developement
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.