Ferreteria/v0.6/clade/IO/O/View

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | IO‎ | O
Jump to navigation Jump to search
The item documented here has been removed and is no longer in use.
clade: IO\O\View
Clade Family
StandardBase View (?)
Clade Aliases
Alias Clade
Base* [c,i] Aux\StandardBase
Subpages

About

  • Purpose: base class for array/element Viewer classes

Status

  • 2025-01-14 started
  • 2026-01-15 Honestly, though, this whole folder is a bit of a mess. xTODO: tidy up
  • 2026-01-26 Removing this clade-family entirely but saving it in case it suddenly starts to make sense.
    • Using Config\Style instead.

Pages

  • Debug (clade): removed
  • List (clade): removed
  • TTY removed (xTODO: should be lowercased): namespace for TTY-view implementations
  • Web removed (xTODO: should be lowercased): namespace for Web-view implementations

Code

2026-01-26

Entire contents of file, as deleted today:

<?php namespace Woozalia\Ferret\IO\O;
// DOCS:

/* Base* [c,i] */ use Woozalia\Ferret\Aux\{ cStandardBase as BaseClass, iStandardBase as BaseIface };

interface iView extends BaseIface {
    function Render() : string;
    function RenderInline() : string;
    function RenderBlock() : string;
}
trait tView {
    // ++ SETUP ++ //

    public function __construct(private BaseIface $oSubj){}
    protected function Subject() : BaseIface { return $this->oSubj; }

    // -- SETUP -- //
    // ++ OUTPUT ++ //

    protected function RenderBefore() : string  { return $this->PrefixString(); }
    protected function RenderAfter() : string { return $this->SuffixString(); }
    protected function RenderElement(iElement $o) : string { return $o->Render(); }

    public function RenderInline() : string { return self::PromptForMethod(); }
    public function RenderBlock() : string { return self::PromptForMethod(); }

    // -- OUTPUT -- //
}
abstract class caView extends BaseClass implements iView { use tView; }

2025-06-22

Commented out a few days or weeks ago:

#
    public static function FromSubject() : self {
        $oThis = new static;
        $oThis->WithSubject($o);
        return $oThis;
    }

    // ++ SETUP: dynamic ++ //

    protected $oSubj;
    protected function WithSubject(BaseIface $o) { $this->oSubj = $o; }
    protected function Subject() : BaseIface { return $this->oSubj; }

Commented out 2025-02-20:

#
    // CEMENT: Element
    // 2025-02-20 Elements() isn't defined here. Hiding this until I figure out where it's appropriate to put it.
    public function Render() : string {
        $ar = $this->Elements();
        $sOut = $this->RenderBefore();
        foreach ($ar as $oElem) {
            $sOut .= $this->RenderElement($oElem);
        }
        $sOut .= $this->RenderAfter();
        return $sOut;
    }