Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public function setTest()
  2. {
  3. $test = true;
  4.  
  5. $event = new Event($this, array(
  6. 'test' => $test
  7. ));
  8.  
  9. $this->onAfterSetTest($event);
  10.  
  11. return $test;
  12. }
  13.  
  14. public function onAfterSetTest(Event $event)
  15. {
  16. $this->raiseEvent('onAfterSetTest', $event);
  17. }
  18.  
  19. craft()->on('myPlugin_myService.afterSetTest', function(Event $event)
  20. {
  21. $event->params['test'] = false;
  22. });
  23.  
  24. public function setTest()
  25. {
  26. // ...
  27.  
  28. $test = $event->params['test']
  29.  
  30. return $test;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement