1 | <?php |
||
14 | class RouteController extends ControllerBase { |
||
15 | |||
16 | /** |
||
17 | * @var \Drupal\graphql\GraphQL\Execution\QueryProcessor |
||
18 | */ |
||
19 | protected $queryProcessor; |
||
20 | |||
21 | /** |
||
22 | * @var \Drupal\Core\Template\TwigEnvironment |
||
23 | */ |
||
24 | protected $twig; |
||
25 | |||
26 | /** |
||
27 | * @inheritdoc |
||
28 | */ |
||
29 | public static function create(ContainerInterface $container) { |
||
35 | |||
36 | /** |
||
37 | * RouteController constructor. |
||
38 | * |
||
39 | * @param \Drupal\graphql\GraphQL\Execution\QueryProcessor $processor |
||
40 | * A GraphQL query processor. |
||
41 | * @param \Drupal\Core\Template\TwigEnvironment $twig |
||
42 | * A Twig environment. |
||
43 | */ |
||
44 | public function __construct(QueryProcessor $processor, TwigEnvironment $twig) { |
||
48 | |||
49 | /** |
||
50 | * Generic page callback. |
||
51 | * |
||
52 | * Accepts a theme hook and an array of theme variables. |
||
53 | * |
||
54 | * @param $_graphql_theme_hook |
||
55 | * The theme hook. |
||
56 | * @param $_graphql_arguments |
||
57 | * Query arguments |
||
58 | * |
||
59 | * @return array |
||
60 | * The render array build. |
||
61 | */ |
||
62 | public function page($_graphql_theme_hook, $_graphql_arguments) { |
||
68 | |||
69 | /** |
||
70 | * Build a page title from a twig template and a GraphQL query. |
||
71 | * |
||
72 | * @param $_graphql_title |
||
73 | * @param $_graphql_title_query |
||
74 | * @param $_graphql_arguments |
||
75 | * |
||
76 | * @return \Drupal\Component\Render\MarkupInterface|\Drupal\Core\StringTranslation\TranslatableMarkup|string |
||
77 | * @throws \Drupal\Component\Plugin\Exception\PluginException |
||
78 | */ |
||
79 | public function title($_graphql_title, $_graphql_title_query, $_graphql_arguments) { |
||
94 | |||
95 | } |
||
96 |