FilsController.php 763 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace Drupal\edlp_fils\Controller;
  3. use Drupal\Core\Controller\ControllerBase;
  4. // use Drupal\Core\Datetime\DrupalDateTime;
  5. use Symfony\Component\HttpFoundation\JsonResponse;
  6. class FilsController extends ControllerBase {
  7. /**
  8. * Display productions as a page.
  9. *
  10. * @return renderable array
  11. */
  12. public function fils() {
  13. return array(
  14. "#markup"=>"Edlp Fils"
  15. );
  16. }
  17. /**
  18. * Get agenda data as json through ajax.
  19. *
  20. * @return json
  21. */
  22. public function filsjson() {
  23. $response = new JsonResponse();
  24. $renderable = array(
  25. "#markup"=>"Edlp Fils"
  26. );
  27. $rendered = render($renderable);
  28. $response->setData([
  29. 'test'=>'hello',
  30. 'rendered'=> $rendered
  31. ]);
  32. return $response;
  33. }
  34. }