RSS Feed/News Redirecting a form with a confirmation message

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
28,037
Points
823

Reputation:

I have the following method:

PHP:

Code:
    public function actionToggleTrigger(\XF\Mvc\ParameterBag $params)
    {
        $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...

Read more

Continue reading...
 
Status
Not open for further replies.
Top