Guest User

Untitled

a guest
Aug 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php defined('BASEPATH') OR exit('No direct script access allowed');
  2. /**
  3. * Sample Events Class
  4. *
  5. * @package PyroCMS
  6. * @subpackage Sample Module
  7. * @category events
  8. * @author PyroCMS Dev Team
  9. */
  10. class Events_Sample
  11. {
  12. protected $ci;
  13.  
  14. public function __construct()
  15. {
  16. $this->ci =& get_instance();
  17.  
  18. // register the public_controller event when this file is autoloaded
  19. Events::register('public_controller', array($this, 'run'));
  20. }
  21.  
  22. // this will be triggered by the Events::trigger('public_controller') code in Public_Controller.php
  23. public function run()
  24. {
  25. // you can load a model or etc here if you like using $this->ci->load();
  26. return 'The Public Controller has ran';
  27. }
  28.  
  29. }
  30. /* End of file events.php */
Add Comment
Please, Sign In to add comment