Skip to content

Instantly share code, notes, and snippets.

@cebe
Created October 25, 2013 13:55
Show Gist options
  • Save cebe/7155082 to your computer and use it in GitHub Desktop.
Save cebe/7155082 to your computer and use it in GitHub Desktop.
trait event handling thinking...
<?php
trait BehaviorA
{
public function handleExampleEvent()
{
// do something
}
}
<?php
trait BehaviorA
{
public function handleExampleEvent()
{
// do something
}
public function handleAnotherEvent()
{
// do something
}
}
<?php
class MyComponent extends Component
{
use BehaviorA, BehaviorB {
BehaviorA::handleExampleEvent as handleExampleEvent1;
BehaviorB::handleExampleEvent as handleExampleEvent2;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment