public function getTemplate($path, $templatingEngine = null)
 {
     $_g = $this;
     if ($this->cache !== null && $this->cache->exists($path)) {
         $cached = $this->cache->get($path);
         if ($templatingEngine === null || $templatingEngine->type === $cached->a) {
             return tink_core__Future_Future_Impl_::sync(tink_core_Outcome::Success($cached->b));
         }
     }
     $tplStrReady = new tink_core_FutureTrigger();
     $ext = haxe_io_Path::extension($path);
     $finalPath = null;
     if ($templatingEngine !== null && $ext !== "") {
         $finalPath = $path;
         $this1 = $this->getTemplateString($finalPath);
         $this1(array(new _hx_lambda(array(&$_g, &$ext, &$finalPath, &$path, &$templatingEngine, &$this1, &$tplStrReady), "ufront_view_UFViewEngine_0"), 'execute'));
     } else {
         if ($templatingEngine !== null && $ext === "") {
             $exts = $templatingEngine->extensions->copy();
             $testNextExtension = null;
             $testNextExtension1 = null;
             $testNextExtension1 = array(new _hx_lambda(array(&$_g, &$ext, &$exts, &$finalPath, &$path, &$templatingEngine, &$testNextExtension, &$testNextExtension1, &$tplStrReady), "ufront_view_UFViewEngine_1"), 'execute');
             $testNextExtension = $testNextExtension1;
             call_user_func($testNextExtension);
         } else {
             if ($templatingEngine === null && $ext !== "") {
                 $tplEngines = $this->engines->copy();
                 $testNextEngine = null;
                 $testNextEngine1 = null;
                 $testNextEngine1 = array(new _hx_lambda(array(&$_g, &$ext, &$finalPath, &$path, &$templatingEngine, &$testNextEngine, &$testNextEngine1, &$tplEngines, &$tplStrReady), "ufront_view_UFViewEngine_2"), 'execute');
                 $testNextEngine = $testNextEngine1;
                 call_user_func($testNextEngine);
             } else {
                 if ($templatingEngine === null && $ext === "") {
                     $tplEngines1 = $this->engines->copy();
                     $engine1 = null;
                     $extensions = new _hx_array(array());
                     $extensionsUsed = new _hx_array(array());
                     $ext2 = null;
                     $testNextEngineOrExtension = null;
                     $testNextEngineOrExtension1 = null;
                     $testNextEngineOrExtension1 = array(new _hx_lambda(array(&$_g, &$engine1, &$ext, &$ext2, &$extensions, &$extensionsUsed, &$finalPath, &$path, &$templatingEngine, &$testNextEngineOrExtension, &$testNextEngineOrExtension1, &$tplEngines1, &$tplStrReady), "ufront_view_UFViewEngine_3"), 'execute');
                     $testNextEngineOrExtension = $testNextEngineOrExtension1;
                     call_user_func($testNextEngineOrExtension);
                 }
             }
         }
     }
     return tink_core__Future_Future_Impl_::_tryFailingMap($tplStrReady->future, array(new _hx_lambda(array(&$_g, &$ext, &$finalPath, &$path, &$templatingEngine, &$tplStrReady), "ufront_view_UFViewEngine_4"), 'execute'));
 }