-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XML/YML support #9
Comments
Sample xml config could be <?xml version="1.0" encoding="UTF-8" ?>
<filter-mapping>
<class name="App\Entity\User">
<property name="name">
<rule name="StripTags">
<option name="allowed"><![CDATA[<b>,<i>]]></option>
</rule>
<rule name="Zend">
<option name="class">Zend\Filter\HtmlEntities</option>
<option name="zendOptions">
<option name="doublequote">false</option>
</option>
</rule>
<rule name="Trim"/>
<rule name="StripNewlines"/>
</property>
<property name="email">
<rule name="StripTags"/>
<rule name="Trim"/>
<rule name="StripNewlines"/>
</property>
</class>
</filter-mapping> example yaml config: App\Entity\User:
properties:
name:
- StripTags: {allowed: '<b>'}
- Zend:
class: 'Zend\Filter\HtmlEntities'
zendOptions: {doublequote: false}
- Trim: ~
- StripNewlines: ~
email:
- Zend: {class: 'Zend\Filter\HtmlEntities', zendOptions: {doublequote: false}}
- StripTags: ~
- Trim: ~
- StripNewlines: ~ I committed some changes to a fork: https://github.com/gfreeau/dms-filter/commits/feature-config-formats and made a sample test file: https://gist.github.com/gfreeau/9d8df717026c2ddc7dcc output of the test is
A lot of the code is similar to what is already in the validation component, there is a possibility of some re-use there if it were re-factored. I just need to add support for loader chains to load multiple xml/yml files and add some tests. |
The README states this is only configured with annotations, it seems the config could also be loaded from yml/xml as well to make it more inline with other components such as validator or doctrine.
What are the chances of this?
The current loader seems to be similar to how the symfony validation component does it for annotations.
The text was updated successfully, but these errors were encountered: