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

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | IO‎ | O‎ | View‎ | Web
Jump to navigation Jump to search
The item documented here has been removed and is no longer in use.
clade: IO\O\View\Web\Table
Clade Family
Table Table (none)
Clade Aliases
Alias Clade
Subpages

Code

Entire contents of file, as deleted on 2026-01-26:

<?php namespace Woozalia\Ferret\IO\O\View\Web;
/**
  PURPOSE: Layout-class descendants for HTML
  HISTORY:
    2021-10-26 started
    2023-10-22 renamespacing for v0.6
    2024-09-17 moved from [WF]IO\O\Screen\Markup\HTML -> [WF]IO\O\Screen\Render\Web
    2024-10-20 moved from [WF]IO\O\Screen\Render\Web -> IO\O\Render\Web
 */

use Woozalia\Ferret\IO\O\Data\Element\Branch\grid\caTable as LayoutClass;
use Woozalia\Ferret\IO\O\Markup\HTML\csTags as TagFx;

class cTable extends LayoutClass {
    // ++ CONFIG ++ //

    // CEMENT: BaseClass
    protected function RowClass() : string { return cRow::class; }

    // -- CONFIG -- //
    // ++ OUTPUT ++ //

    public function Render() : string {
        $arAt = $this->GetAttrs();
        $htAt = TagFx::ArrayToAttrs($arAt);

        $out = "<table$htAt>\n";
        
        $arRows = $this->GetRows();
        foreach ($arRows as $oRow) {
            $arCells = $oRow->GetCells();
            $htRow = '<tr>';
            $htCellTag = $oRow->IsHeader() ? 'th' : 'td';
            foreach ($arCells as $oCell) {
                $sVal = $oCell->GetValue();
                $arAt = $oCell->GetAttrs();
                $htAt = TagFx::ArrayToAttrs($arAt);
                $htCell = "<$htCellTag$htAt>$sVal</$htCellTag>";
                $htRow .= $htCell;
            }
            $htRow .= "</tr>\n";
            $out .= $htRow;
        }
        $out .= "</table>\n";
        
        return $out;
    }

    // -- OUTPUT -- //
}