Ferreteria/v0.5/@cls/cElement: Difference between revisions

From Woozle Writes Code
< Ferreteria‎ | v0.5‎ | @cls
Jump to navigation Jump to search
No edit summary
Line 20: Line 20:
General event-handling is defined by {{l/ver/class|tExecutableTree}}.
General event-handling is defined by {{l/ver/class|tExecutableTree}}.
===event: rendering===
===event: rendering===
* <syntaxhighlight lang=php inline>public    function RenderOutput() : string { return $this->RenderValue(); }</syntaxhighlight>
* {{l/ver/meth|layout/event|RenderOutput}}<syntaxhighlight lang=php inline>: string { return $this->RenderValue(); }</syntaxhighlight>
* <syntaxhighlight lang=php inline>protected function RenderValue()  : string { return $this->RenderBranch(); }</syntaxhighlight>
* {{l/ver/meth|layout/event|RenderValue}}<syntaxhighlight lang=php inline>: string { return $this->RenderBranch(); }</syntaxhighlight>
* <syntaxhighlight lang=php inline>protected function RenderBranch() : string { /*...*/ }</syntaxhighlight>:
* {{l/ver/meth|layout/event|RenderBranch}}<syntaxhighlight lang=php inline>: string { /*...*/ }</syntaxhighlight>:
** <syntaxhighlight lang=php inline>if $this->ShouldDoTwigs()</syntaxhighlight>, then:
** <syntaxhighlight lang=php inline>if $this->ShouldDoTwigs()</syntaxhighlight>, then:
*** <syntaxhighlight lang=php inline>return $this->RenderTwigs();</syntaxhighlight>
*** <syntaxhighlight lang=php inline>return $this->RenderTwigs();</syntaxhighlight>
*** else return empty string
*** else return empty string
* <syntaxhighlight lang=php inline>protected function RenderTwigs()  : string { /* call twig->RenderOutput() for each twig */ }</syntaxhighlight>
* {{l/ver/meth|layout/event|RenderTwigs}}<syntaxhighlight lang=php inline>: string { /* call twig->RenderOutput() for each twig */ }</syntaxhighlight>
* <syntaxhighlight lang=php inline>protected function ShouldDoTwigs() : bool { return TRUE; }</syntaxhighlight>
* {{l/ver/meth|layout/event|ShouldDoTwigs}}<syntaxhighlight lang=php inline>: bool { return TRUE; }</syntaxhighlight>

Revision as of 22:29, 21 July 2022

Ferreteria class ferret\layout\cElement

tExecutableTree
tRenderableTwig

cElement

caContentHeader
cNavElement
caPageContent
cSectionHeader
html\caTag
caWebPage
login\caWidget

Methods

events

General event-handling is defined by tExecutableTree.

event: rendering

  • RenderOutput(): string { return $this->RenderValue(); }
  • RenderValue(): string { return $this->RenderBranch(); }
  • RenderBranch(): string { /*...*/ }:
    • if $this->ShouldDoTwigs(), then:
      • return $this->RenderTwigs();
      • else return empty string
  • RenderTwigs(): string { /* call twig->RenderOutput() for each twig */ }
  • ShouldDoTwigs(): bool { return TRUE; }