You are here

public function PoptinController::check in Website Popups, Email Popup, Exit-Intent Popup, and Contact Forms – Poptin 8

Implements check().

1 string reference to 'PoptinController::check'
poptin.routing.yml in ./poptin.routing.yml
poptin.routing.yml

File

src/Controller/PoptinController.php, line 57

Class

PoptinController
Provides route responses for the Poptin module.

Namespace

Drupal\poptin\Controller

Code

public function check() {
  if (!$this
    ->poptinIsUser()) {
    $regclass = "yes";
  }
  else {
    $regclass = 'no';
  }
  $csrftoken = $this
    ->poptinGetToken();
  $module_img_dir = $this->baseUrlT . '/' . drupal_get_path('module', 'poptin') . '/images/';
  $generateloginlink = $this->baseUrlT . '/admin/config/poptin/poptinGeneratePoptinLink?csrftoken=' . $csrftoken;
  $poptin_deactivate = $this->baseUrlT . '/admin/config/poptin/poptinDeactivate';
  return [
    '#theme' => 'main_template',
    '#test_var' => $regclass,
    '#csrftoken' => $csrftoken,
    '#module_img_dir' => $module_img_dir,
    '#base_url' => $this->baseUrlT,
    '#generateloginlink' => $generateloginlink,
    '#deactivate_url' => $poptin_deactivate,
  ];
}