Ferreteria/v0.6/clade/IO/O/Data/Element/Branch/Text/@code/cur/2026/01/29

From WoozleCodes
Jump to navigation Jump to search
2026/01/28 2026/01/29 2026/01/30

More revision will definitely be needed before it works again; there will be at least one language error:

interface iText extends BaseIface, StyledIface {
     function SText(string $s=NULL) : string;
}

class cText extends BaseClass implements iText {
    use StyledTrait;

    // ++ SETUP ++ //

    public function __construct(ElemIface $o, string $s) {
        parent::__construct($o);
        $this->WithString($s);
    }

    // ++ SETUP: dynamic ++ //

    private $s;
    protected function WithString(string $s) { $this->s = $s; }
    protected function Value() : string { return $this->s; }

    // -- SETUP -- //
    // ++ SETTINGS ++ //

    // TEMPLATE
    private $oStyle = NULL;
    public function OStyle() : StyleIface {
        $o = $this->oStyle;
        if (is_null($o)) {
            $o = $this->oStyle = new (static::StyleClass());
        }
        $o->OData($this);
        return $o;
    }

    // -- SETTINGS -- //
    // ++ DATA ++ //

    private $s = NULL;
    public function SText(string $s=NULL) : string { return is_null($s) ? $this->s : ($this->s = $s); }

    // -- DATA -- //
    // ++ OUTPUT ++ //

    public function RenderSelf() : string { return $this->s.CRLF; }

    /* 2026-01-29 Is this still needed/used?
    // CEMENT BaseIface
    public function ShowIt() { echo $this->SText(); }
    */

    // -- OUTPUT -- //
}