Ferreteria/v2/class/ftExecutableTree: Difference between revisions
< Ferreteria | v2 | class
Jump to navigation
Jump to search
mNo edit summary |
m (2 revisions imported: moving this project here) |
(No difference)
|
Latest revision as of 16:45, 22 May 2022
- file: Template:L/ferreteria/file
- uses: Template:L/version
- used by:
Code
// PURPOSE: So an ExecutableTwig node will pass events down to its subnodes
trait ftExecutableTree {
use ftExecutableTwig;
// ++ OVERRIDE ++ //
public function DoEvent($nEvent) {
$this->OnEventBefore($nEvent);
if ($this->HasNodes()) {
$ar = $this->GetNodes();
foreach ($ar as $name => $oNode) {
$oNode->DoEvent($nEvent);
}
}
$this->OnEventAfter($nEvent);
}
// -- OVERRIDE -- //
// ++ NEW ++ //
// PURPOSE: by default, Self handles event before passing it down
protected function OnEventBefore($nEvent) { $this->OnEventDispatch($nEvent); }
protected function OnEventAfter($nEvent) {} // stub
// -- NEW -- //
}