File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php namespace Feather \Gear \Skeleton ;
2+
3+ /**
4+ * All gears should extend the Gear Foundation component.
5+ */
6+ use Feather \Components \Gear \Foundation ;
7+
8+ class Bone extends Foundation {
9+
10+ /**
11+ * The constructor of a gear contains the events that it listens to. Events can execute
12+ * closures or methods on the class.
13+ *
14+ * @return void
15+ */
16+ public function __construct ()
17+ {
18+ // Listen for an event and execute a callback when the event is fired by Feather.
19+ $ this ->listen ('event ' , function ()
20+ {
21+ // Depending on the event you may be required to return a value or null.
22+ });
23+
24+ // Listen for an event and execute a method on the class.
25+ $ this ->listen ('event ' , 'method ' );
26+
27+ // Override existing events that are listening for the same event.
28+ $ this ->override ('event ' , 'method ' );
29+ }
30+
31+ /**
32+ * This method will be executed when the event is fired by Feather.
33+ *
34+ * @return void
35+ */
36+ public function method (){}
37+
38+ }
You can’t perform that action at this time.
0 commit comments