protected function findTemplate($name)
 {
     $throw = func_num_args() > 1 ? func_get_arg(1) : true;
     $name = $this->normalizeName($name);
     if (isset($this->cache[$name])) {
         return $this->cache[$name];
     }
     if (isset($this->errorCache[$name])) {
         if (!$throw) {
             return false;
         }
         throw new \Twig_Error_Loader($this->errorCache[$name]);
     }
     $this->validateName($name);
     list($module, $shortname) = $this->parseName($name);
     if (null == $module) {
         // currentSegment
         $viewPath = $this->currentSegment->resolvePath('views/' . $shortname);
     } elseif (true === $module) {
         // Root
         $viewPath = $this->application->resolvePath('views/' . $shortname);
     } else {
         // Module
         $viewPath = $this->application->getModuleManager()->getModule($module)->resolvePath('views/' . $shortname);
     }
     if (is_file($viewPath)) {
         return $this->cache[$name] = $viewPath;
     }
     $this->errorCache[$name] = sprintf('Unable to find template "%s"  (File does not exist: %s).', $name, $viewPath);
     if (!$throw) {
         return false;
     }
     throw new \Twig_Error_Loader($this->errorCache[$name]);
 }