Comments (13)
@cordoval @pmjones any thoughts on this?
What I was thinking was getParams or getTokens . Paul was having an idea of using the rule itself back in the filter.
Thoughts ?
from aura.filter.
Closing for a different approach is being used.
from aura.filter.
Hi Paul,
I don't know whether I am throwing something before the complete implementation. But I would like to ask a question .
I feel when we are using something like FILTER_SOMETHING
it is easy for people to make use of translate $this->translate('FILTER_SOMETHING')
. In some cases we may need more stuffs like the minimum length, maximum, between etc. In that case it would be good to also get these token values so it can be passed as $this->translate('FILTER_SOMETHING', $params)
.
If it is just string like field should have validated as strlenMin(6)
things may be hard to translate I assume. Your thoughts ?
Apart from that the reorg
branch seems nice.
Thank you
from aura.filter.
Fair question!
First, the "strlen(6)" thing is a default message only, and is intended to be overridden with a custom message. You provide a custom message by specifying the rule mode, e.g. ->asSoftRule("Please enter a valid email address.")
.
For translation, you could enter "FILTER_SOMETHING" as the message, and then pass it through a translator at output time, but it still doesn't get you the filter arguments, like 6 as in strlenMin(6).
To support translations with interpolated argument values, I can see where we would have to change the getMessages() return format so that it returns both the string message and the filter arguments. Let me think about that one a little bit.
from aura.filter.
@pmjones this was what I did earlier https://github.com/auraphp/Aura.Filter/pull/53/files . But as things are changed it need a bit different ways though .
from aura.filter.
I think we're getting closer to a final implementation here. Do you think this issue is still important, or is it something we can let go?
from aura.filter.
Hi @pmjones ,
I think this issue is a bit important when you want to deal with translation.
What I thought was keeping something like having a constant values and use some getTokens
or something to get the tokens. The user can later use a translator like Aura.Intl or other ones which does the conversion.
from aura.filter.
from aura.filter.
Thank you @pmjones . Looks good 👍 .
from aura.filter.
By the way @pmjones in case if you have not forgotten https://groups.google.com/d/msg/auraphp/dVpSOV6RnM4/BZLPpYzMoDQJ before a beta release good to have common interface, so it can communicate with Aura.Input also ?
from aura.filter.
Closed by #84 .
from aura.filter.
@harikt The rules for Aura 1.x packages are such that they cannot depend on external packages, which means even if there was an interface package, Aura.Input 1.x could not depend on it. At the worst, though, there could be a "bridge" interface between the two in yet another package.
from aura.filter.
@pmjones As Aura.Filter is v2, we can bring an interface to 2.0 . And later the 1.0 package can be bumped to 2.0 to use the same interface package. No other changes for Aura.Input .
from aura.filter.
Related Issues (20)
- can't use validate rule 'blank' at "2.0.0" HOT 35
- Sanitize to remove html HOT 5
- PSR-7 upload validator? HOT 14
- isNotBlank gone HOT 4
- dev branch isNotBlank not working as expected HOT 10
- Need docs for character case rules HOT 1
- Multidimensional Subjects and Variable Length Members HOT 7
- Sanitize to Field If Blank? HOT 2
- JsonSerializable HOT 6
- Sanitize is causing validation error HOT 3
- Arise PHP Notice when I try to sanitize HOT 2
- custom rules not applying when field is blank HOT 10
- Are there any plans for 3.0 stable release? HOT 1
- best way to validate each item in array HOT 2
- idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated HOT 5
- Stop rule does not stop processing HOT 2
- What is the future of this project? HOT 1
- Need help on how to use this? HOT 1
- Packagist releases HOT 6
- 4.x :: Multidimensional support and failures
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aura.filter.