@@ -71,41 +71,41 @@ The `HeadStyle` helper is a concrete implementation of the
7171>
7272> class MyRenderer extends PhpRenderer
7373> {
74- > /**
75- > * @var string
76- > */
77- > protected $encoding;
78- >
79- > /**
80- > * Constructor
81- > *
82- > * @param string $encoding The encoding to be used
83- > */
84- > public function __construct($encoding)
85- > {
86- > parent::__construct();
87- > $this->encoding = $encoding;
88- > }
89- >
90- > /**
91- > * Sets the encoding
92- > *
93- > * @param string $encoding The encoding to be used
94- > */
95- > public function setEncoding($encoding)
96- > {
97- > $this->encoding = $encoding;
98- > }
99- >
100- > /**
101- > * Gets the encoding
102- > *
103- > * @return string The encoding being used
104- > */
105- > public function getEncoding()
106- > {
107- > return $this->encoding;
108- > }
74+ > /**
75+ > * @var string
76+ > */
77+ > protected $encoding;
78+ >
79+ > /**
80+ > * Constructor
81+ > *
82+ > * @param string $encoding The encoding to be used
83+ > */
84+ > public function __construct($encoding)
85+ > {
86+ > parent::__construct();
87+ > $this->encoding = $encoding;
88+ > }
89+ >
90+ > /**
91+ > * Sets the encoding
92+ > *
93+ > * @param string $encoding The encoding to be used
94+ > */
95+ > public function setEncoding($encoding)
96+ > {
97+ > $this->encoding = $encoding;
98+ > }
99+ >
100+ > /**
101+ > * Gets the encoding
102+ > *
103+ > * @return string The encoding being used
104+ > */
105+ > public function getEncoding()
106+ > {
107+ > return $this->encoding;
108+ > }
109109> }
110110> ```
111111>
@@ -121,35 +121,35 @@ The `HeadStyle` helper is a concrete implementation of the
121121>
122122> class Module
123123> {
124- > public function getConfig(){/* ... */}
125- >
126- > public function getAutoloaderConfig(){/* ... */}
127- >
128- > public function getServiceConfig()
129- > {
130- > return [
131- > 'factories' => [
132- > // Register our custom renderer in the container
133- > 'MyCustomRenderer' => function ($container) {
134- > return new MyRenderer('ISO-8859-1');
135- > },
136- > 'MyCustomStrategy' => function ($container) {
137- > // As stated before, we just want to implement the
138- > // getEncoding() method, so we can use the base PhpRendererStrategy
139- > // and provide our custom renderer to it.
140- > $myRenderer = $container->get('MyCustomRenderer');
141- > return new PhpRendererStrategy($myRenderer);
142- > },
143- > ],
144- > ];
145- > }
146- >
147- > public function onBootstrap(MvcEvent $e)
148- > {
149- > // Register a render event
150- > $app = $e->getParam('application');
151- > $app->getEventManager()->attach('render', [$this, 'registerMyStrategy'], 100);
152- > }
124+ > public function getConfig(){/* ... */}
125+ >
126+ > public function getAutoloaderConfig(){/* ... */}
127+ >
128+ > public function getServiceConfig()
129+ > {
130+ > return [
131+ > 'factories' => [
132+ > // Register our custom renderer in the container
133+ > 'MyCustomRenderer' => function ($container) {
134+ > return new MyRenderer('ISO-8859-1');
135+ > },
136+ > 'MyCustomStrategy' => function ($container) {
137+ > // As stated before, we just want to implement the
138+ > // getEncoding() method, so we can use the base PhpRendererStrategy
139+ > // and provide our custom renderer to it.
140+ > $myRenderer = $container->get('MyCustomRenderer');
141+ > return new PhpRendererStrategy($myRenderer);
142+ > },
143+ > ],
144+ > ];
145+ > }
146+ >
147+ > public function onBootstrap(MvcEvent $e)
148+ > {
149+ > // Register a render event
150+ > $app = $e->getParam('application');
151+ > $app->getEventManager()->attach('render', [$this, 'registerMyStrategy'], 100);
152+ > }
153153>
154154> public function registerMyStrategy(MvcEvent $e)
155155> {
0 commit comments