title: Codeigniter 3: add class "has-error" to the form group containing an invalid field
body: <p>I have a form with text-fields defined as such (in the view file): </p>
  
  <pre><code>&lt;div class="form-group"&gt;
      &lt;?php echo form_input('email', '', [
          'type'  =&gt; 'text',
          'id'    =&gt; 'email', 
          'class' =&gt; 'form-control',
          'value' =&gt; '',
          'placeholder' =&gt; 'Email address',
          ]); 
      ?&gt;
      &lt;?php echo form_error('email'); ?&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>In the controller I have enabled error messages:</p>
  
  <pre><code>$this-&gt;form_validation-&gt;set_error_delimiters('&lt;p class="error"&gt;', '&lt;/p&gt;');
  </code></pre>
  
  <p>I would like to add the class "has-error" to the <code>&lt;div class="form-group"&gt;</code> when errors are displayed. How do I do that?</p>