What you are looking for is called a viewing assistant HeadStyle. Its reference documentation can be found here .
The helper API is HeadStylecompatible with all view helpers Head*and works as such (assuming you are in viewcript):
$this->headStyle()->offsetSetStyle(100, $customStyles);
$this->headStyle()->appendStyle($finalStyles);
$this->headStyle()->prependStyle($firstStyles);
<?php $this->headStyle()->captureStart() ?>
body {
background-color: <?php echo $this->bgColor ?>;
}
<?php $this->headStyle()->captureEnd() ?>
, <style> . .
echo , :
<head>
<?php echo $this->headLink() ?>
<?php echo $this->headStyle() ?>
</head>