ikkez / f3-validation-engine

Validation engine for Cortex and the PHP Fat-Free Framework
GNU General Public License v3.0
12 stars 2 forks source link

Cortex validation: Change case conversion of error contexts #4

Closed adkurz closed 3 years ago

adkurz commented 3 years ago

Instead of convert the whole string of error contexts to lowercase, only change the first letter of namespace / class

old: MyModels\FileLocation = mymodels.filelocation

new: MyModels\FileLocation = myModels.fileLocation

This corresponds to standard of var names in php (camel case with first letter in lowercase)

ikkez commented 3 years ago

Thanks for the nice addition. It absolutely makes sense. To keep it simple and the compatibility, it's now a custom function, so you can to set your own behaviour: https://github.com/ikkez/f3-validation-engine#custom-model-context-name-conversion