-
-
Save benedmunds/657de89b26decda2b2fa to your computer and use it in GitHub Desktop.
CodeIgniter Ion Auth - set_hooks example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this would probably be in a library or model | |
class activity | |
{ | |
function add($type) | |
{ | |
$this->db->insert('activity', array( | |
'type' => $type, | |
'datetime' => 'now()', | |
)); | |
} | |
} | |
//set the hook | |
$this->ion_auth->set_hook('post_register', 'add_meta', 'activity', 'add', array('user_added')); | |
//other stuff... | |
//after this is called the hook will be executed automatically | |
$this->ion_auth->register(... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,@benedmunds
I can run your example. The data in the table is entered correctly.by:
$this->ion_auth->set_hook('post_register', 'add_meta', 'activity', 'add', array('user_added'));
But why does not the following command answer?
$this->ion_auth->set_hook('post_activate', 'add_meta', 'activity', 'add', array('user_added'));
And i reviewed the following. The correct operation is not done.
please guide me?