You are here

public function LegalController::legalPageAction in Legal 8

Same name and namespace in other branches
  1. 2.0.x src/Controller/LegalController.php \Drupal\legal\Controller\LegalController::legalPageAction()

Page callback.

Return value

array Render array of terms and conditions.

1 string reference to 'LegalController::legalPageAction'
legal.routing.yml in ./legal.routing.yml
legal.routing.yml

File

src/Controller/LegalController.php, line 20

Class

LegalController
Class LegalController.

Namespace

Drupal\legal\Controller

Code

public function legalPageAction() {
  $language = $this
    ->languageManager()
    ->getCurrentLanguage();
  $conditions = legal_get_conditions($language
    ->getId());
  return [
    '#type' => 'markup',
    '#markup' => check_markup($conditions['conditions'], $conditions['format'], $conditions['language']),
  ];
}