Ferreteria/v0.6/clade/App/Routed

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | App
Revision as of 23:41, 18 October 2025 by Woozle (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
clade: App\Routed
Clade Family
App Routed

Cmd
Web

Clade Aliases
Alias Clade
Base* [ca,i] App
Globals [cs] Config\Globals
KioskIface Sys\Routing\Kiosk
Subpages

About

  • PURPOSE: trait for App classes that will use standard Routing management

History

  • 2024-09-13 started: extracted ReceiveRequest() from cWeb
  • 2024-11-05 HomeKiosk() is abstract for this instar, because futils app classes just create the Kiosk as needed.
    • Later note: I think this means they never call it.
  • 2025-03-05 Changing trait tRouted into class cRouted.

Pages

Code

as of 2025-10-18

interface iRouted extends BaseIface {}
abstract class caRouted extends BaseClass implements iRouted {
    // ++ CONFIG ++ //

    abstract protected function KioskClass() : string;

    // -- CONFIG -- //
    // ++ SETUP ++ //

    // CEMENT
    protected function ReadAppConfig() {
        $this->HomeKiosk()->Setup();
    }

    // -- SETUP -- //
    // ++ FACTORY ++ //

    #abstract protected function HomeKiosk() : KioskIface;
    private $oHK=NULL; protected function HomeKiosk() : KioskIface { return $this->oHK ?? ($this->oHK = $this->NewHomeKiosk()); }
    protected function NewHomeKiosk() : KioskIface { return ($this->KioskClass())::FromGlobals(); }

    // -- FACTORY -- //
    // ++ ACTION ++ //

    protected function ReadUserCommand() {
        $oKiosk = $this->HomeKiosk();
        #echo $oKiosk->ReflectThis()->Report();
        $this->AmHere('Home Kiosk: '.get_class($oKiosk)); // 2025-10-14 Is this even being called??
        $oKiosk->ReadInput();
    }
    protected function ExecuteActions() {
        $oKiosk = $this->HomeKiosk();
        $oKiosk->RunInput();
    }

    // -- ACTION -- //
}