title: CakePHP 2.2 validation trim() error
body: <p>This is quite strange, I have a text input in a registration form and when I am setting the $validate array in the model, I am getting a trim() error - Warning (2): trim() expects parameter 1 to be string, array given [CORE\Cake\View\Helper.php, line 754]</p>
  
  <p>Form input</p>
  
  <pre><code>&lt;?=$this-&gt;Form-&gt;input("lastname", array("label" =&gt; array("text" =&gt; "Last name *"), "class" =&gt; "required", "div" =&gt; array("class" =&gt; array("input text last")))); ?&gt;
  </code></pre>
  
  <p>Model validate array</p>
  
  <pre><code>public $validate = array(
          'lastname' =&gt; array(
              'required' =&gt; array(
                  'rule' =&gt; array('notEmpty'),
                  'message' =&gt; 'Last name is required'
              )
          )
      );
  </code></pre>
  
  <p>It seems that when I am doing a validation rule for that field, the div styling array - "div" => array("class" => array("input text last")) is causing the error. I added the following code to the Helper.php file as a workaround:</p>
  
  <pre><code>if(is_array($options["class"])) {
              $options["class"] = $options["class"][0];
          }
  </code></pre>
  
  <p>but I would like to know why it is causing this error.</p>