Automattic\WooCommerce\Vendor\Sabberworm\CSS
OutputFormatter::implode
Clone of the implode function, but calls render with the current output format instead of __toString().
Method of the class: OutputFormatter{}
No Hooks.
Returns
String.
Usage
$OutputFormatter = new OutputFormatter(); $OutputFormatter->implode( $sSeparator, $aValues, $bIncreaseLevel );
- $sSeparator(string) (required)
- .
- $aValues(array) (required)
- .
- $bIncreaseLevel(true|false)
- .
Default:false
OutputFormatter::implode() OutputFormatter::implode code WC 10.8.1
public function implode($sSeparator, array $aValues, $bIncreaseLevel = false)
{
$sResult = '';
$oFormat = $this->oFormat;
if ($bIncreaseLevel) {
$oFormat = $oFormat->nextLevel();
}
$bIsFirst = true;
foreach ($aValues as $mValue) {
if ($bIsFirst) {
$bIsFirst = false;
} else {
$sResult .= $sSeparator;
}
if ($mValue instanceof Renderable) {
$sResult .= $mValue->render($oFormat);
} else {
$sResult .= $mValue;
}
}
return $sResult;
}