symbols[$symbol] = true;
$this->needsResolve = true;
return $this;
}
private function resolveResources() {
if ($this->needsResolve) {
$map = CelerityResourceMap::getInstance();
$this->resolved = $map->resolveResources(array_keys($this->symbols));
$this->needsResolve = false;
}
return $this;
}
public function renderResourcesOfType($type) {
$this->resolveResources();
$output = array();
foreach ($this->resolved as $resource) {
if ($resource['type'] == $type) {
$output[] = $this->renderResource($resource);
}
}
return implode("\n", $output);
}
private function renderResource(array $resource) {
switch ($resource['type']) {
case 'css':
$path = phutil_escape_html($resource['path']);
return '';
case 'js':
$path = phutil_escape_html($resource['path']);
return '';
}
throw new Exception("Unable to render resource.");
}
}