You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -193,3 +193,31 @@ To provide dependencies to other classes after they are instantiated, in additio
193
193
parent::__construct();
194
194
}
195
195
```
196
+
197
+
### Registering your own compiler pass
198
+
199
+
Create a [custom compiler pass](https://github.com/inviqa/magento-symfony-container/blob/master/app/code/community/Inviqa/SymfonyContainer/Model/InjectableCompilerPass.php) class in your project.
200
+
201
+
Create a Magento observer and configure it to listen to the `symfony_container_before_container_generator` Magento event.
202
+
Update this observer to inject the custom compiler pass into the generator config, as shown below:
203
+
204
+
```php
205
+
class Inviqa_DependencyInjection_Model_Observer
206
+
{
207
+
/** @var CustomCompilerPass */
208
+
private $customCompilerPass;
209
+
210
+
public function __construct()
211
+
{
212
+
$this->customCompilerPass = new CustomCompilerPass();
213
+
}
214
+
215
+
public function onBeforeContainerGenerator(Varien_Event_Observer $observer)
0 commit comments