Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 721 Bytes

README.markdown

File metadata and controls

51 lines (37 loc) · 721 Bytes

#Sample Usage

class Controller_Welcome extends Controller {

	public function action_index()
	{
		$this->request->response = 'hello, world!';

		$foo = 'foo';

		Event::add('test_one', array($this, 'one'));
		Event::add('test_two', array($this, 'two'));

		Event::run('test_one', $foo);

		echo $foo.'
'; } public function one() { echo Event::$data.'
'; Event::$data = 'bar'; $blah = 'inner_foo'; Event::run('test_two', $blah); echo $blah.'
'; echo Event::$data.'
'; } public function two() { echo Event::$data.'
'; Event::$data = 'inner_foo_modified!'; } } // End Welcome

Output

foo
inner_foo
inner_foo_modified!
bar
bar
hello, world!