Lee
Guest
offline
I have the following method:
PHP:
Read more
Continue reading...
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...