utils icon indicating copy to clipboard operation
utils copied to clipboard

How can I customize response messages for the user

Open andretx33 opened this issue 1 year ago • 1 comments
trafficstars

how can I customize response messages for the user

try { $arr = ['title' => 'aa', 'bar' => 'a', 'foo' => 'a']; v::assert($arr['title'], 'string:5', 'example message 1'); v::assert($arr['bar'], 'string:15', 'example message 2'); v::assert($arr['foo'], 'int', 'example message 3'); } catch (AssertionException $e) { echo '<pre>'; print_r($e->getMessage()); }

current answer The **example message 1** expects to be string in range 5, string 'aa' given.

the current message appears between the default message.

thanks

andretx33 avatar May 27 '24 20:05 andretx33