$this->data['message'] = array('type'=>'error','details'=>(validation_errors()) ? validation_errors() : $this->session->flashdata('message'));
$this->session->set_flashdata('message', array('type'=>'success','details'=>$this->ion_auth->messages()));
<?php if (!empty($message['details'])): ?> <div class="message <?=$message['type']?>"> <?php if(is_array($message['details'])):?> <ul> <?php foreach($message['details'] AS $error): ?> <li><?=$error?></li> <?php endforeach;?> </ul> <?php else: ?> <?=$message['details']?> <?php endif; ?> </div> <?php endif;?>