本文整理汇总了PHP中Events::register方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::register方法的具体用法?PHP Events::register怎么用?PHP Events::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events::register方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->ci =& get_instance();
$this->fallbacks = array('comments' => array('comments' => 'email/comment'), 'contact' => array('contact' => 'email/contact'));
//register the email event
Events::register('email', array($this, 'send_email'));
}
示例2: init
/**
* Register listeners for events
*/
public function init()
{
Events::register('settings_general_update', array($this, 'general_update'));
Events::register('settings_authentication_update', array($this, 'authentication_update'));
Events::register('settings_ldap_update', array($this, 'ldap_update'));
Events::register('settings_ldap_groups_update', array($this, 'ldap_groups_update'));
Events::register('settings_preauth_update', array($this, 'preauth_update'));
}
示例3: __construct
public function __construct($order_id)
{
$this->order_id = (int) $order_id;
//При генериации счета
Events::register('generateInvoice2', array($this, 'reservePriceInprogress'));
//Вешаем обработку события при генерации файла
Events::register('generate_file', array($this, 'saveFileForEvents'));
}
示例4: __construct
public function __construct()
{
$this->ci =& get_instance();
// register the public_controller event when this file is autoloaded
Events::register('post_user_register', array($this, 'save_authentication'));
// Post a blog to twitter and whatnot
Events::register('blog_article_published', array($this, 'post_status'));
}
示例5: __construct
public function __construct()
{
// this is triggered on every front-end page load and run_system_cron() checks
// to see if this is a bot. If it's a bot we don't care if they get a slightly slower page load
Events::register('public_controller', array($this, 'run_system_cron'));
// this is a just a regular task that we use to maintain the session table.
// Other modules can implement a cron task in a similar manner
Events::register('system_cron', array($this, 'clean_sessions'));
}
示例6: register_events
private function register_events()
{
/**
* Register events to be hooked.
* Add more if required. :)
*/
Events::register('before_invoice_number_generated', array($this, 'before_invoice_number_generated'));
Events::register('invoice_number_generated', array($this, 'invoice_number_generated'));
}
示例7: __construct
public function __construct()
{
$this->ci =& get_instance();
$this->ci->load->library('settings');
$this->settings = $this->ci->settings;
if ($this->settings->get('mailer_enabled')) {
Events::register('contact_form_submitted', array($this, 'contact_form_submitted_send_confirmation'));
}
}
示例8: __construct
public function __construct()
{
$this->ci =& get_instance();
$this->ci->load->model(array('Routes_model'));
$this->ci->load->library('Ion_auth');
$this->Routes_model = $this->ci->Routes_model;
Events::register('user_updated', array($this, 'run_update'));
Events::register('post_user_register', array($this, 'run_created'));
Events::register('post_user_update', array($this, 'run_update'));
}
示例9: __construct
public function __construct()
{
$this->CI =& get_instance();
// Register the admin_notification event
Events::register('admin_notification', array($this, 'display_notifications'));
// Delete the row_m and streams cache on create/update/delete
Events::register('streams_post_insert_entry', array($this, 'clear_cache'));
Events::register('streams_post_update_entry', array($this, 'clear_cache'));
Events::register('streams_post_delete_entry', array($this, 'clear_cache'));
}
示例10: __construct
public function __construct()
{
$this->ci = get_instance();
$this->ci->load->library('settings');
$this->settings = $this->ci->settings;
if ($this->settings->get('mailer_enabled')) {
Events::register('email', array($this, 'email'));
Events::register('email_test', array($this, 'email_test'));
}
}
示例11: __construct
public function __construct()
{
$this->ci =& get_instance();
// register the events
Events::register('product_created', array($this, 'product_created'));
Events::register('product_updated', array($this, 'product_updated'));
Events::register('product_delete', array($this, 'product_deleted'));
Events::register('product_duplicated', array($this, 'product_duplicated'));
Events::register('product_viewed', array($this, 'product_viewed'));
Events::register('order_complete', array($this, 'order_complete'));
Events::register('cart_item_added', array($this, 'cart_item_added'));
Events::register('cart_updated', array($this, 'cart_updated'));
Events::register('page_build', array($this, 'page_build'));
}
示例12: __construct
public function __construct()
{
$this->ci =& get_instance();
// Load the search index model
$this->ci->load->model('search/search_index_m');
// Post a blog to twitter and whatnot
Events::register('post_published', array($this, 'index_post'));
Events::register('post_updated', array($this, 'index_post'));
Events::register('post_deleted', array($this, 'drop_post'));
// Post a blog to twitter and whatnot
Events::register('page_created', array($this, 'index_page'));
Events::register('page_updated', array($this, 'index_page'));
Events::register('page_deleted', array($this, 'drop_page'));
}
示例13: __construct
public function __construct()
{
$this->ci =& get_instance();
// Register the events
Events::register('cron_process_1', array($this, 'process_1'));
Events::register('cron_process_5', array($this, 'process_5'));
Events::register('cron_process_10', array($this, 'process_10'));
Events::register('cron_process_15', array($this, 'process_15'));
Events::register('cron_process_30', array($this, 'process_30'));
Events::register('cron_process_60', array($this, 'process_60'));
Events::register('cron_process_86400', array($this, 'process_86400'));
// 1 day
// Weekly days
Events::register('cron_process_sunday', array($this, 'process_sunday'));
Events::register('cron_process_monday', array($this, 'process_monday'));
Events::register('cron_process_tuesday', array($this, 'process_tuesday'));
Events::register('cron_process_wednesday', array($this, 'process_wednesday'));
Events::register('cron_process_thursday', array($this, 'process_thursday'));
Events::register('cron_process_friday', array($this, 'process_friday'));
Events::register('cron_process_saturday', array($this, 'process_saturday'));
// Monthly
Events::register('cron_process_monthly', array($this, 'process_monthly'));
}
示例14: test_array_callback
public function test_array_callback()
{
Events::register('test_array_callback', array($this, 'callback'));
$arr = array('foo' => 'bar');
$this->assertEquals(Events::trigger('test_array_callback', $arr), $this->callback($arr));
}
示例15: __construct
public function __construct()
{
$this->ci =& get_instance();
Events::register('order_update', array($this, 'run'));
}