Redirecting a form with a confirmation message

Status
This content is read-only, or is not open for further replies.

Lee

Guest
offline
I have the following method:

PHP:

Code:
    public function actionToggleTrigger()
    {
        $this->assertPostOnly();
   
        $visitor = \XF::visitor();
        if (!$visitor->user_id) {
            return $this->noPermission();
        }
   
        $profile = $visitor->Profile;
        $current = $profile->custom_fields->ToggleTrigger ?? '0';
        $new = $current === '1' ? '0' : '1';
   
        $profile->custom_fields->ToggleTrigger = $new;
        $profile->save()...

Read more

Continue reading...
 
Liked by:
Status
This content is read-only, or is not open for further replies.
Top Bottom