Exemplo n.º 1
0
 /**
  * Get the modified time of a given template file
  * @param string $template Name of template file being loaded
  * @return int
  */
 public static function getModifiedTime($template)
 {
     if (Templates::composerTemplate($template) === false) {
         return filemtime(Templator::$templateLocation);
     } else {
         return filemtime($_SERVER['DOCUMENT_ROOT'] . '/vendor/' . Templates::$composerFile);
     }
 }
Exemplo n.º 2
0
 /**
  * Check to make sure that the requested template file exists
  * @param string $template Name of template file being loaded
  * @throws Exception
  * @return void
  */
 public static function checkTemplateExists($template)
 {
     if (!file_exists(self::$templateLocation)) {
         //Check to see if the template is a composer file
         if (Templates::composerTemplate($template) === false) {
             throw new Exception("The template '{$template}' doesn't exist");
         }
     }
 }