From 1c9ba5979cbb5cdc172afbcbd8c4d5e8d0899db4 Mon Sep 17 00:00:00 2001 From: George Steel Date: Thu, 31 Oct 2024 09:59:29 +0000 Subject: [PATCH] Reinstate line-highlights removed in #58 Signed-off-by: George Steel --- .../usage-in-a-laminas-mvc-application.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/book/application-integration/usage-in-a-laminas-mvc-application.md b/doc/book/application-integration/usage-in-a-laminas-mvc-application.md index a8a6cad..3d887b8 100644 --- a/doc/book/application-integration/usage-in-a-laminas-mvc-application.md +++ b/doc/book/application-integration/usage-in-a-laminas-mvc-application.md @@ -59,7 +59,9 @@ To register a listener in a laminas-mvc based application, use either applicatio This example uses module configuration, e.g. `module/Application/config/module.config.php`: -```php + + +

 namespace Application;
 
 return [
@@ -68,7 +70,7 @@ return [
     ],
     // …
 ];
-```
+
All listeners registered in this way are fetched from the application service container. This means the listeners must be registered for the application service container to discover and create them. @@ -76,7 +78,7 @@ This means the listeners must be registered for the application service containe To register the listener for the application service container, extend the configuration of the module. Add the following lines to the module configuration file, e.g. `module/Application/config/module.config.php`: -```php +

 namespace Application;
 
 use Laminas\ServiceManager\AbstractFactory\ReflectionBasedAbstractFactory;
@@ -89,7 +91,9 @@ return [
     ],
     // …
 ];
-```
+
+ + The example uses the [reflection factory from laminas-servicemanager](https://docs.laminas.dev/laminas-servicemanager/reflection-abstract-factory/) to resolve the constructor dependencies for the listener class.