- Posts: 19
- Thank you received: 1
The sequence of events and their early termination
1 week 20 hours 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?
Please Log in to join the conversation.
1 week 19 hours ago - 1 week 19 hours 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:
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: 1 week 19 hours ago by alorenc.
Please Log in to join the conversation.
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 14226
- Thank you received: 2514
1 week 13 hours 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.
Please Log in to join the conversation.