Ferreteria/v2/class/fcPage

From Woozle Writes Code
< Ferreteria‎ | v2‎ | class
Jump to navigation Jump to search

Template:Page/code/class

Calls

Code

// NOTE: This is already a sort of vaguely-HTMLish page because it (optionally) does DOCTYPE.
abstract class fcPage extends fcPageElement {
    use ftRenderableTree, ftExecutableTree;
    
    // ++ EXECUTION ++ //
    
    public function DoBuilding() {
	$this->DoEvent(KI_NODE_EVENT_DO_BUILDING);
    }
    public function DoFiguring() {
	$this->DoEvent(KI_NODE_EVENT_DO_FIGURING);
    }
    public function DoOutput() {
	echo $this->Render();
    }

    // -- EXECUTION -- //
    // ++ CLASSES ++ //
    
    protected function DocTypeClass() {
	return 'fcpeDocType';
    }
    
    // -- CLASSES -- //
    // ++ NODES ++ //
    
    protected function DocTypeNode() {
	return $this->Spawn($this->DocTypeClass());
    }

    // -- NODES -- //
    // ++ I/O ++ //
    
    abstract public function AddContentString($s);
    abstract public function DoStashedRedirect($url);
    /*----
      CEMENT
      NOTE: All of a Page's contents are subnodes; it has none aside from that.
    */
    public function Render() {
	return $this->RenderNodes();
    }

    // -- I/O -- //

}