Skip to content

Commit

Permalink
Merge pull request bcit-ci#173 from nihaopaul/2
Browse files Browse the repository at this point in the history
documentation updates only
  • Loading branch information
benedmunds committed Mar 5, 2012
2 parents d585eea + e537d54 commit 7028299
Showing 1 changed file with 97 additions and 2 deletions.
99 changes: 97 additions & 2 deletions userguide/index.html
Expand Up @@ -67,6 +67,8 @@ <h3>Class Functions</h3>
<li><a href="#set_message_delimiters">set_message_delimiters()</a></li>
<li><a href="#errors">errors()</a></li>
<li><a href="#set_error_delimiters">set_error_delimiters()</a></li>
<li><a href="#trigger_events">trigger_events()</a></li>
<li><a href="#set_hook">set_hook</a></li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -275,7 +277,7 @@ <h2>register()</h2>
<br />

<a name="update_user"></a>
<h2>update_user()</h2>
<h2>update()</h2>
<p>Update a user.</p>

<p><strong>Parameters</strong></p>
Expand All @@ -297,7 +299,7 @@ <h2>update_user()</h2>
'last_name' => 'Edmunds',
'password' => '123456789',
);
$this->ion_auth->update_user($id, $data)
$this->ion_auth->update($id, $data)
</pre>
<br />

Expand Down Expand Up @@ -784,6 +786,99 @@ <h2>set_error_delimiters()</h2>
</pre>
<br />

<a name="set_hook"></a>
<h2>set_hook()></h2>
<p>Set a single or multiple functions to be called when trigged by trigger_events()</p>

<p><strong>Parameters</strong></p>
<ol>
<li>'Event' - string REQUIRED.</li>
<li>'Name' - string REQUIRED.</li>
<li>'Class' - string REQUIRED.</li>
<li>'Method' - string REQUIRED.</li>
<li>'Arguments' - Array OPTIONAL.</li>
</ol>

<p><b>Usage</b></p>
<pre>
class Accounts extends CI_Controller {

public function __construct()
{
parent::__construct();

/*
make sure we loaded ion_auth2
The following does not need to go in __construct() it just needs to be set before
you trigger_events().
*/
$event = 'socialpush';
$class = 'Accounts';
$args = array('this is the content of the message', 'billy');

$name = 'activate_sendmail';
$method = 'email';
$this->ion_auth->set_hook($event, $name, $class, $method, $args);
$name = 'call_Twitter';
$method = 'twitter';
$this->ion_auth->set_hook($event, $name, $class, $method, $args);
$name = 'call_MailChimp_API';
$method = 'mailchimp';
$this->ion_auth->set_hook($event, $name, $class, $method, $args);
$name = 'call_Facebook_API';
$method = 'facebook';
$this->ion_auth->set_hook($event, $name, $class, $method, $args);
$name = 'call_gPlus_API';
$method = 'gplus';
$this->ion_auth->set_hook($event, $name, $class, $method, $args);
}

public function Post_Message($one)
{
$this->ion_auth->trigger_events('socialpush');
}
public function email($content, $who)
{
return true;
}
public function twitter($content, $who)
{
return true;
}
public function mailchimp($content, $who)
{
return true;
}
public function facebook($content, $who)
{
return true;
}
public function gplus($content, $who)
{
return true;
}
}
</pre>
<br />




<a name="trigger_events"></a>
<h2>trigger_events()</h2>
<p>Call Additional functions to run that were registered with <a href="#set_hook">set_hook()</a>.</p>

<p><strong>Parameters</strong></p>
<ol>
<li>'Name' - String or Array REQUIRED.</li>
</ol>

<p><b>Usage</b></p>
<pre>
$this->ion_auth->trigger_events('socialpush');
</pre>
<br />

</div>
<!-- END CONTENT -->

Expand Down

0 comments on commit 7028299

Please sign in to comment.