public function renderStyleAssets($collection = null) { $output = ''; if ($collection) { $collection = $this->getCollection($collection); } else { $collection = $this->collections[$this->selectedCollection]; } if ($collection) { $assets = $collection->getAssets(); foreach ($assets['style'] as $asset) { if ($asset->isRemote()) { $output .= $asset->render() . "\n"; } else { if (!$this->cdnBaseUrl) { $output .= $asset->render() . "\n"; } } } if ($this->cdnBaseUrl) { $assetPath = "{$this->cdnBaseUrl}/" . $collection->getName(); $assetPath .= '.css'; $style = new Style($assetPath); $output .= $style->render() . "\n"; } foreach ($assets['embeddedStyle'] as $asset) { $output .= $asset->render() . "\n"; } } $runtimeAssets = $this->runtimeCollection->getAssets(); foreach ($runtimeAssets['style'] as $asset) { $output .= $asset->render() . "\n"; } foreach ($runtimeAssets['embeddedStyle'] as $asset) { $output .= $asset->render() . "\n"; } return $output; }