From d978a16031eacabf924699ce35f04885205f50dc Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Sun, 20 Aug 2023 16:58:53 +0200 Subject: [PATCH] mention unavailability of DIC inside components --- en/controllers/components.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/en/controllers/components.rst b/en/controllers/components.rst index aa4df27d18..0e095c8003 100644 --- a/en/controllers/components.rst +++ b/en/controllers/components.rst @@ -152,6 +152,12 @@ in your controller, you could access it like so:: properties they share the same 'namespace'. Be sure to not give a component and a model the same name. +.. warning:: + + Component methods **don't** have access to :doc:`/development/dependency-injection` + like Controller actions have. Use a service class inside your controller actions + instead of a component if you need this functionality. + .. _creating-a-component: Creating a Component