|
Perforce Chronicle 2012.2/486814
API Documentation
|
Extends the head style helper to add media queries support. More...
Public Member Functions | |
| itemToString (stdClass $item, $indent) | |
| Convert content and attributes into valid style tag. | |
Extends the head style helper to add media queries support.
| P4Cms_View_Helper_HeadStyle::itemToString | ( | stdClass $ | item, |
| $ | indent | ||
| ) |
Convert content and attributes into valid style tag.
We add the item's media value to _mediaTypes and then call the parent method. This way, the media type validation in the parent is ignored.
| stdClass | $item | Item to render |
| string | $indent | Indentation to use |
{
$value = isset($item->attributes['media']) ? $item->attributes['media'] : '';
if (false === strpos($value, ',')) {
$this->_mediaTypes[] = $value;
} else {
foreach (explode(',', $value) as $type) {
$this->_mediaTypes[] = trim($type);
}
}
return parent::itemToString($item, $indent);
}