- $eval = sprintf("\$tplEngine = %s::create%s(\"%s%s\", \$lang, \$io);",
- FrameworkConfiguration::getInstance()->readConfig("tpl_engine"),
- FrameworkConfiguration::getInstance()->readConfig("tpl_engine"),
- PATH,
- FrameworkConfiguration::getInstance()->readConfig("tpl_base_path")
- );
- eval($eval);
- } catch (BasePathIsEmptyException $e) {
- die(sprintf("[Main:] Die Template-Engine konnte nicht initialisieren. Grund: <strong>%s</strong>",
- $e->getMessage()
- ));
- } catch (InvalidBasePathStringException $e) {
- die(sprintf("[Main:] Die Template-Engine konnte nicht initialisieren. Grund: <strong>%s</strong>",
- $e->getMessage()
- ));
- } catch (BasePathIsNoDirectoryException $e) {
- die(sprintf("[Main:] Die Template-Engine konnte nicht initialisieren. Grund: <strong>%s</strong>",
- $e->getMessage()
- ));
- } catch (BasePathReadProtectedException $e) {
- die(sprintf("[Main:] Die Template-Engine konnte nicht initialisieren. Grund: <strong>%s</strong>",
+ // Get the template instance from our object factory
+ $templateInstance = ObjectFactory::createObjectByName($tpl, array(FrameworkConfiguration::getInstance()->readConfig('tpl_base_path'), $lang, $io));
+ } catch (FrameworkException $e) {
+ die(sprintf("[Main:] Could not initialize template engine for reason: <span class=\"exception_reason\">%s</span>",