//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(... |
This comment has been minimized.
This comment has been minimized.
Change your controller to something like this, note the way the class is passed:
|
This comment has been minimized.
This comment has been minimized.
thanks! |
This comment has been minimized.
This comment has been minimized.
Is there a way to pass data into the event? I'm trying to create a hook for "post_account_creation_successful" for updating a MailChimp Mailing List, but I'm not sure how to obtain the user information from the event to pipe that to the MailChimp API. |
This comment has been minimized.
This comment has been minimized.
thanks |
This comment has been minimized.
This comment has been minimized.
Can I have the hooked method in one controller and set_hook() run from another controller? |
This comment has been minimized.
This comment has been minimized.
Is there a way for me to pass data in the present ion-auth function into my own function? i want to hash both the activation code and the id found in the link sent to user's email addresses, in order to activate their account. Then inside the activate (inside ion-auth-model) i want to 'un-hash' it so that ion-auth flow can continue as normal.. |
This comment has been minimized.
This comment has been minimized.
Hello,@benedmunds
please guide me? |
This comment has been minimized.
I keep getting the " Using $this when not in object context" error when trying to call the set_hook from my controller.
say i have something like this:
In Controller
Model
The script chokes on the "foreach($this->meta_cols as $cols)" line when called with the set_hook function.