fuel / core

Fuel PHP Framework - The core of the Fuel v1 framework
http://fuelphp.com
813 stars 345 forks source link

Allow add_rule of Validation class to be passed an anomymus function #319

Closed Philipp15b closed 13 years ago

Philipp15b commented 13 years ago

Hello, it would be very helpful to be able to pass an anonymus function to add_rule() of the Validation class. This would make own validations much easier.

jschreuder commented 13 years ago

You can't? It should already be possible...

Philipp15b commented 13 years ago

Really? Hidden feature ;)

jschreuder commented 13 years ago

From the docs: "The first parameter of the add_rule() method can contain PHP native function names, any valid PHP callback and Closures in addition to the provided validation methods. The method will get the value to be validated as its first argument and any further arguments can be given to the add_rule() method." - http://fuelphp.com/docs/classes/validation.html

Philipp15b commented 13 years ago

Oops, did'nt see it...