Automattic\WooCommerce\Vendor\Sabberworm\CSS\CSSList

CSSList::renderListContentsprotectedWC 1.0

Method of the class: CSSList{}

No Hooks.

Returns

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->renderListContents( $oOutputFormat );
$oOutputFormat(OutputFormat) (required)
.

CSSList::renderListContents() code WC 10.5.0

protected function renderListContents(OutputFormat $oOutputFormat)
{
    $sResult = '';
    $bIsFirst = true;
    $oNextLevel = $oOutputFormat;
    if (!$this->isRootList()) {
        $oNextLevel = $oOutputFormat->nextLevel();
    }
    foreach ($this->aContents as $oContent) {
        $sRendered = $oOutputFormat->safely(function () use ($oNextLevel, $oContent) {
            return $oContent->render($oNextLevel);
        });
        if ($sRendered === null) {
            continue;
        }
        if ($bIsFirst) {
            $bIsFirst = false;
            $sResult .= $oNextLevel->spaceBeforeBlocks();
        } else {
            $sResult .= $oNextLevel->spaceBetweenBlocks();
        }
        $sResult .= $sRendered;
    }

    if (!$bIsFirst) {
        // Had some output
        $sResult .= $oOutputFormat->spaceAfterBlocks();
    }

    return $sResult;
}