Ejemplo n.º 1
0
 /**
     Creates a Template from file.
     @param string $filename foldername.
     @param bool   $save     if true no syntax check will be done.
     @return object.
     **/
 public static function loadTemplate($filename, $save = false)
 {
     if (\histou\helper\Str::endswith($filename, '.php')) {
         return static::loadPHPTemplates($filename, $save);
     } elseif (\histou\helper\Str::endswith($filename, '.simple')) {
         return static::loadSimpleTemplates($filename);
     }
 }
Ejemplo n.º 2
0
 /**
     Returns true if the fileending is a valid one.
     @param string $filename path or filename.
     @return bool true if it ends with '.simple' or '.php'.
     **/
 private static function isValidFile($filename)
 {
     return \histou\helper\Str::endswith($filename, '.simple') || \histou\helper\Str::endswith($filename, '.php');
 }