Configure RuleLocator readme section missing
Closed this issue · 2 comments
chrissound commented
In the readme you have the the following:
(Note that if we instantiate manually, we will need to configure the RuleLocator manually to add rule services. See the "Advanced Usage" section near the end of this page for more information.)
This section doesn't seem to be present?
harikt commented
@chrissound This is what we need to link to https://github.com/auraphp/Aura.Filter#set-the-class-as-a-service .
Example
<?php
$locator = $filter->getRuleLocator();
$locator->set('hex', function () {
return new Vendor\Package\Filter\Rule\Hex;
});
also see scripts/instance.php
file.
pmjones commented
I have just addressed this in the 2.x branch: https://github.com/auraphp/Aura.Filter/blob/2.x/docs/custom.md#set-a-factory-in-the-locator