You are here

public function TawkToWidgetController::widgetsContent 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::widgetsContent()

Constructs a widgets content.

Return value

array Renderable array.

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

File

src/Controller/TawkToWidgetController.php, line 99

Class

TawkToWidgetController
Controller routine that manages tawk.to widget settings.

Namespace

Drupal\tawk_to\Controller

Code

public function widgetsContent() {
  $items = [];
  $items['baseUrl'] = self::TAWK_TO_PLUGINS_URL;
  $items['iframeUrl'] = $this
    ->tawkToGetIframeUrl();
  return [
    '#theme' => 'tawk_to_iframe',
    '#items' => $items,
  ];
}