public function getPartialPathAndFilename($partialName)
{
$patternReplacementVariables = array_merge($this->patternReplacementVariables, ['partial' => $partialName]);
if (strpos($partialName, ':') !== false) {
list($packageKey, $actualPartialName) = explode(':', $partialName);
$package = $this->packageManager->getPackage($packageKey);
$patternReplacementVariables['package'] = $packageKey;
$patternReplacementVariables['packageResourcesPath'] = $package->getResourcesPath();
$patternReplacementVariables['partial'] = $actualPartialName;
}
$paths = $this->expandGenericPathPattern($this->options['partialPathAndFilenamePattern'], $patternReplacementVariables, true, true);
foreach ($paths as $partialPathAndFilename) {
if (is_file($partialPathAndFilename)) {
return $partialPathAndFilename;
}
}
throw new Exception\InvalidTemplateResourceException('The partial files "' . implode('", "', $paths) . '" could not be loaded.', 1225709595);
}