Welcome Guest, Not a member yet? Register   Sign In
Ion Auth - Lightweight Auth System based on Redux Auth 2

[eluser]roark[/eluser]
Hi Ben,

Great 'plugin' thanks for the great work!

Regarding the flashdata/messaging/errors implementation, what do you think about setting the message type i.e.
Code:
$this->data['message'] = array('type'=>'error','details'=>(validation_errors()) ? validation_errors() : $this->session->flashdata('message'));
And...
Code:
$this->session->set_flashdata('message', array('type'=>'success','details'=>$this->ion_auth->messages()));

This will allow us to style the front-end depening on the message type...

Code:
<?php if (!empty($message['details'])): ?>
    <div class="message &lt;?=$message['type']?&gt;">
        &lt;?php if(is_array($message['details'])):?&gt;
        <ul>
            &lt;?php foreach($message['details'] AS $error): ?&gt;
            <li>&lt;?=$error?&gt;</li>
            &lt;?php endforeach;?&gt;
        </ul>
        &lt;?php else: ?&gt;
        &lt;?=$message['details']?&gt;
        &lt;?php endif; ?&gt;
    </div>
    &lt;?php endif;?&gt;

It may not be the ideal way to handle this, but I've implemented it successfully in one of my projects.

Thanks again!


Messages In This Thread
Ion Auth - Lightweight Auth System based on Redux Auth 2 - by El Forum - 05-31-2011, 12:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB