SimplifyingController.php in Simplifying 8
File
src/Controller/SimplifyingController.php
View source
<?php
namespace Drupal\simplifying\Controller;
use Drupal\Core\Controller\ControllerBase;
class SimplifyingController extends ControllerBase {
public function services() {
$langcode = self::getLangcode();
$content['page'] = [
'#theme' => 'simplifying_services',
'#data' => [
'langcode' => $langcode,
'base_url' => $GLOBALS['base_url'],
],
];
return $content;
}
public function training() {
$langcode = self::getLangcode();
$content['page'] = [
'#theme' => 'simplifying_training',
'#data' => [
'langcode' => $langcode,
],
];
return $content;
}
public static function getLangcode() {
$lengcode = \Drupal::languageManager()
->getCurrentLanguage()
->getId();
if (!in_array($lengcode, [
'uk',
'ru',
])) {
$lengcode = 'en';
}
return $lengcode;
}
}