title: cakephp 3 how to change the custom rule validation message in fly
body: <p>I have created a custom rule, and i need to change the message on fly. </p>
  
  <p>For example consider the following code. In this i need to show the appropriate message instead of rule message(Error Number) based on the constraints</p>
  
  <pre><code>public function validationDefault(Validator $validator)
  {
             $validator-&gt;add(
                      'number_field',
                      [
                          'custom' =&gt; [
                              'rule' =&gt; function ($value, $context) {
                                  if ($value &lt; 10) {
                                      //need to change the error message as its less than 10
                                  } else if ($value &gt; 10 &amp;&amp; $value &lt;20) {
                                      //need change the error message its between 10 and 20
                                  }
                                  return true;
                              },
                              'message' =&gt; 'Error number'
                          ]
                      ]
                  );
       return $validator;
  }
  </code></pre>