You are here

public function TawkToWidgetController::removeWidget in Tawk.to - Live chat application (Drupal 8) 8.2

Same name and namespace in other branches
  1. 8 src/Controller/TawkToWidgetController.php \Drupal\tawk_to\Controller\TawkToWidgetController::removeWidget()

Callback for removing widget with ajax in tawk.to iframe.

Return value

\Symfony\Component\HttpFoundation\JsonResponse JSON object for JS code.

1 string reference to 'TawkToWidgetController::removeWidget'
tawk_to.routing.yml in ./tawk_to.routing.yml
tawk_to.routing.yml

File

src/Controller/TawkToWidgetController.php, line 135

Class

TawkToWidgetController
Controller routine that manages tawk.to widget settings.

Namespace

Drupal\tawk_to\Controller

Code

public function removeWidget() {
  $this->config
    ->clear('tawk_to_widget_page_id')
    ->save();
  $this->config
    ->clear('tawk_to_widget_id')
    ->save();
  return new JsonResponse([
    'success' => TRUE,
  ]);
}