From 3b60b00f9c6f4c39fb0c24f33cb4e796c37c53a8 Mon Sep 17 00:00:00 2001 From: Tobias Duehr Date: Tue, 29 Aug 2017 12:21:36 +0200 Subject: [PATCH] read language files --- readme.md | 6 +++++- src/Controller/ContentApiController.php | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 8530b6c..b5c5f04 100644 --- a/readme.md +++ b/readme.md @@ -55,8 +55,12 @@ Gets the logged-in frontend user, if available. Gets the content of a module by id +##### /api/text?file=tl_news,modules + +Gets the content of a language file by filename(s) + All routes also take the additional `lang` parameter (e.g. `?lang=de`). If you -have a multilingual website. +need to override the language. ## Custom readers diff --git a/src/Controller/ContentApiController.php b/src/Controller/ContentApiController.php index f9a9b24..8f5e32e 100644 --- a/src/Controller/ContentApiController.php +++ b/src/Controller/ContentApiController.php @@ -81,5 +81,15 @@ public function readerAction(Request $request) return $this->handle($request); } + /** + * @return Response + * + * @Route("/{text}", name="content_api_text") + */ + public function textAction(Request $request) + { + return $this->handle($request); + } + }