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
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 2: Line 2:
{| style="border: solid 1px grey; background: #eef;"
{| style="border: solid 1px grey; background: #eef;"
|-
|-
| {{l/ver/class|tExecutableTree}}
|
| &rarr; {{l/ver/class|cElement}}
{{l/ver/class|tExecutableTree}} &rarr;<br>
{{l/ver/class|tRenderableTree}} &rarr;
| {{l/ver/class|cElement}}
|
|
&rarr; {{l/ver/class|caContentHeader}}<br>
&rarr; {{l/ver/class|caContentHeader}}<br>
Line 13: Line 15:
&rarr; {{l/ver/class|layout/login|login}}\{{l/ver/class|caWidget}}
&rarr; {{l/ver/class|layout/login|login}}\{{l/ver/class|caWidget}}
|}
|}
* '''file''': {{l/ferreteria/code|layout/elem.php}}
* '''file''': {{l/ferreteria/code|layout/elem/1.php}}
==Methods==
==Methods==
===rendering===
===events===
* <syntaxhighlight lang=php inline>public function RenderOutput() : string { return $this->RenderValue(); }</syntaxhighlight>
General event-handling is defined by {{l/ver/class|tExecutableTree}}.
* <syntaxhighlight lang=php inline>protected function RenderValue() : string { return $this->RenderTwigs(); }</syntaxhighlight>
===event dispatch===
* <syntaxhighlight lang=php inline>protected function RenderTwigs() : string { /* call twig->RenderOutput() for each twig */ }</syntaxhighlight>
No change from {{l/ver/class|tExecutableTwig}}.
===event: rendering===
* {{l/ver/meth|layout/event|RenderOutput}}<syntaxhighlight lang=php inline>: string { return $this->RenderValue(); }</syntaxhighlight>
* {{l/ver/meth|layout/event|RenderValue}}<syntaxhighlight lang=php inline>: string { return $this->RenderBranch(); }</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>return $this->RenderTwigs();</syntaxhighlight>
*** else return empty string
* {{l/ver/meth|layout/event|RenderTwigs}}<syntaxhighlight lang=php inline>: string { /* call twig->RenderOutput() for each twig */ }</syntaxhighlight>
==Removed==
* {{l/ver/meth|layout/event|ShouldDoTwigs}}<syntaxhighlight lang=php inline>: bool { return TRUE; }</syntaxhighlight>

Latest revision as of 19:21, 20 August 2023

Ferreteria class ferret\layout\cElement

tExecutableTree
tRenderableTree

cElement

caContentHeader
cNavElement
caPageContent
cSectionHeader
html\caTag
caWebPage
login\caWidget

Methods

events

General event-handling is defined by tExecutableTree.

event dispatch

No change from tExecutableTwig.

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 */ }

Removed