Can I format my validation strings with relevant info in Kohana 3?

sonudenty

New Member
I've noticed in Kohana 3 these error messages provided by default.\[code\]return array( 'not_empty' => ':field must not be empty.',);\[/code\]Obviously, \[code\]:field\[/code\] is replaced with the field name.Now I am validating an image upload. Obviously, I'm allowing only JPG, JPEG, GIF & PNG.I have an error message set up like so.\[code\]return array( 'photo' => array( 'Upload::type' => 'You must upload an image file (JPG, JPEG, GIF, PNG)' ));\[/code\]I also use Kohana's validation helper like so.\[code\]$input->rules('photo', array('Upload::type' => array('Upload::type' => array('jpg', 'jpeg', 'png', 'gif'))));\[/code\]Is there a way I can use those accepted extensions in my error string, perhaps like...\[code\]return array( 'photo' => array( 'Upload::type' => 'You can only upload files of :types' ));\[/code\]
 
Back
Top