Add CSS class with hook I have a search box using custom_search module. I am trying to add multiple classes to the input field using a hook. 

Here is the code I have tried:

&lt;?php
function mytheme_form_search_block_form_alter(&amp;$form, &amp;$form_state) {
      $form['keys']['#attributes']['class'][] = 'custom_search-keys','form-search','form-control';
    }


But it does not add the classes to the search box input field?
Try this one, add class as array.

$form['keys']['#attributes'] = array('class' =&gt; array('custom_search-keys','form-search','form-control'));