Ferreteria/v0.5/@cls/tExecutableTree: Difference between revisions
< Ferreteria | v0.5 | @cls
Jump to navigation
Jump to search
(correction) |
No edit summary |
||
Line 10: | Line 10: | ||
This trait extends {{l/ver/class|tExecutableTwig}} by dispatching events to sub-twigs. | This trait extends {{l/ver/class|tExecutableTwig}} by dispatching events to sub-twigs. | ||
==Methods== | ==Methods== | ||
=== | ===event dispatch=== | ||
* {{l/ver/meth|layout/event|OnEvent}} calls the following, though the exact order has changed: | * {{l/ver/meth|layout/event|OnEvent}} calls the following, though the exact order has changed: | ||
** if {{l/ver/meth|layout/event|ShouldDoTwigs}}, then {{l/ver/meth|layout/event|DoEventTwigs}} | ** if {{l/ver/meth|layout/event|ShouldDoTwigs}}, then {{l/ver/meth|layout/event|DoEventTwigs}} | ||
Line 16: | Line 16: | ||
* {{l/ver/meth|layout/event|DoEventTwigs}} is implemented as you might expect. | * {{l/ver/meth|layout/event|DoEventTwigs}} is implemented as you might expect. | ||
* {{l/ver/meth|layout/event|OnEventLocal}} comes from {{l/ver/class|tExecutableTwig}} | * {{l/ver/meth|layout/event|OnEventLocal}} comes from {{l/ver/class|tExecutableTwig}} | ||
=== | ===event handlers=== | ||
<syntaxhighlight lang=php> | |||
protected function OnBuild(cEventNodeFigure $oe) : void {} // STUB | |||
protected function OnFigure(cEventNodeFigure $oe) : void { $this->StoreRendered($this->RenderOutput()); } | |||
protected function OnRender(cEventNodeRender $oe) : void { $oe->Append($this->FetchRendered()); } | |||
</syntaxhighlight> | |||
===events: rendering=== | |||
* {{l/sub|StoreRendered()}} | |||
* {{l/sub|FetchRendered()}} | |||
* {{l/sub|RenderOutput()}} |
Revision as of 15:25, 2 December 2022
tExecutableTwig → | tExecutableTree | → cElement |
- file: layout/elem/trait.php
About
This trait extends tExecutableTwig by dispatching events to sub-twigs.
Methods
event dispatch
- OnEvent() calls the following, though the exact order has changed:
- if ShouldDoTwigs(), then DoEventTwigs()
- OnEventLocal()
- DoEventTwigs() is implemented as you might expect.
- OnEventLocal() comes from tExecutableTwig
event handlers
protected function OnBuild(cEventNodeFigure $oe) : void {} // STUB
protected function OnFigure(cEventNodeFigure $oe) : void { $this->StoreRendered($this->RenderOutput()); }
protected function OnRender(cEventNodeRender $oe) : void { $oe->Append($this->FetchRendered()); }