Commit e19c2aad authored by Open Source Developer's avatar Open Source Developer

translation

parent 036f923a
<?php
/**
* @file
* Contains \Drupal\query_example\Controller\QueryExampleController.
*/
namespace Drupal\epal\Controller;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Drupal\Core\Controller\ControllerBase;
class CurrentUser extends ControllerBase {
public function content() {
// $name = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
$name = "LALALA";
$authToken = "no authToken";
$accessKey = "no accessKey";
if (\Drupal::request()->headers->has('X-AUTH-TOKEN')) {
$authToken = \Drupal::request()->headers->get( 'X-AUTH-TOKEN' );
}
if (\Drupal::request()->headers->has('X-ACCESS-KEY')) {
$accessKey = \Drupal::request()->headers->get( 'X-ACCESS-KEY' );
}
$response = new JsonResponse([$name]);
$response->headers->set('X-AUTH-TOKEN', 'HELLOTOKEN');
return $response;
}
}
......@@ -16,7 +16,7 @@ use Drupal\Core\Controller\ControllerBase;
* Controller routines for page example routes.
*/
class Login extends ControllerBase {
protected $query_factory;
public function __construct(EntityTypeManagerInterface $entityTypeManager, QueryFactory $query_factory) {
......@@ -130,3 +130,6 @@ public function helloWorld() {
}
}
......@@ -21,7 +21,7 @@ use Drupal\user\UserInterface;
* "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
* "list_builder" = "Drupal\epal\EpalStudentClassListBuilder",
* "views_data" = "Drupal\epal\Entity\EpalStudentClassViewsData",
* "translation" = "Drupal\epal\EpalStudentClassTranslationHandler",
*
*
* "form" = {
* "default" = "Drupal\epal\Form\EpalStudentClassForm",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment