-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevents.php
37 lines (30 loc) · 1.01 KB
/
events.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
* billboard Events Class
*
* @author Marijan Greguric
* @website http://greguric.info
* @package
* @subpackage
* @copyright MIT
*/
class Events_billboard {
protected $ci;
public function __construct()
{
$this->ci =& get_instance();
//register the public_controller event
Events::register('public_controller', array($this, 'run'));
//register a second event that can be called any time.
// To execute the "run" method below you would use: Events::trigger('billboard_event');
// in any php file within PyroCMS, even another module.
Events::register('billboard_event', array($this, 'run'));
}
public function run()
{
$this->ci->load->model('billboard/billboard_m');
// we're fetching this data on each front-end load. You'd probably want to do something with it IRL
$this->ci->billboard_m->limit(5)->get_all();
}
}
/* End of file events.php */