public function configureDependencyInjection(DependencyInjectionContainer $dic,
												 array $moduleConfig,
												 array $globalConfig) {
		/**
		 * @var TemplateEngine[] $engines
		 */
		$engines = [];
		if (empty($moduleConfig[self::CONFIG_ENGINES])) {
			throw new ConfigurationException('The templating module itself was loaded, but there is no module ' .
				' for the actual template engine present. Did you forget to load your templating module?');
		}
		//Create the instances of the template engine to be used with the TemplateRenderingChain
		foreach ($moduleConfig[self::CONFIG_ENGINES] as $engineClass) {
			$engines[] = $dic->make($engineClass);
		}
		if (isset($moduleConfig[self::CONFIG_FILTERS])) {
			foreach ($moduleConfig[self::CONFIG_FILTERS] as $filterClass) {
				$filterInstance = $dic->make($filterClass);
				if ($filterInstance instanceof TemplateFilter) {
					foreach ($engines as $engine) {
						$engine->registerFilter($filterInstance);
					}
				} else {
					throw new ConfigurationException($filterClass . ' does not implement ' . TemplateFilter::class);
				}
			}
		}
		if (isset($moduleConfig[self::CONFIG_FUNCTIONS])) {
			foreach ($moduleConfig[self::CONFIG_FUNCTIONS] as $functionClass) {
				$functionInstance = $dic->make($functionClass);
				if ($functionInstance instanceof TemplateFunction) {
					foreach ($engines as $engine) {
						$engine->registerFunction($functionInstance);
					}
				} else {
					throw new ConfigurationException($functionClass . ' does not implement ' . TemplateFunction::class);
				}
			}
		}
		$dic->setClassParameters(TemplateRenderingChain::class, ['templateEngines' => $engines]);
	}