예제 #1
0
 /**
  * Finds a named template in an app's template paths.
  */
 public static function getTemplatePath(IPieCrust $pieCrust, $templateName)
 {
     $templateName = self::validateTemplateName($templateName);
     foreach ($pieCrust->getTemplatesDirs() as $dir) {
         $path = $dir . '/' . $templateName;
         if (is_file($path)) {
             return $path;
         }
     }
     return false;
 }
예제 #2
0
 /**
  * Finds a named template in an app's template paths.
  */
 public static function getTemplatePath(IPieCrust $pieCrust, $templateName)
 {
     $templateName = self::validateTemplateName($templateName);
     foreach ($pieCrust->getTemplatesDirs() as $dir) {
         $path = $dir . '/' . $templateName;
         if (is_file($path)) {
             return $path;
         }
     }
     throw new PieCrustException("Couldn't find template '" . $templateName . "' in: " . implode(', ', $pieCrust->getTemplatesDirs()));
 }