You are here

LegalController.php in Legal 8

Same filename and directory in other branches
  1. 2.0.x src/Controller/LegalController.php

File

src/Controller/LegalController.php
View source
<?php

namespace Drupal\legal\Controller;

use Drupal\Core\Controller\ControllerBase;

/**
 * Class LegalController.
 *
 * @package Drupal\legal\Controller
 */
class LegalController extends ControllerBase {

  /**
   * Page callback.
   *
   * @return array
   *   Render array of terms and conditions.
   */
  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']),
    ];
  }

}

Classes

Namesort descending Description
LegalController Class LegalController.