public function render($controller, $method, $parameters) {
		$templateMapping = [];
		foreach ($this->templateRoots as $templateRoot) {
			if ($templateRoot['name']) {
				$templateMapping[$templateRoot['name']] = $templateRoot['directory'];
			}
		}

		foreach ($this->templateRoots as $templateRoot) {
			try {
				return $this->renderingChain->render(
					$templateRoot['directory'],
					\str_replace($templateRoot['trim'], '', $controller) . DIRECTORY_SEPARATOR . $method,
					$parameters,
					$templateMapping
				);
			} catch (TemplateNotFoundException $e) {
				//pass
			}
		}
		throw new TemplateNotFoundException('No template available for ' . $controller . '::' . $method .
			' in directories ' . \implode(', ', \array_keys($this->templateRoots)));
	}