Example #1
0
 public static function get_path($relative_path, $relative = false)
 {
     $folders = array_merge(array(self::$template_path), Shutter::get_template_folders(), array(self::$fallback_path));
     foreach ($folders as $folder) {
         $path = str_replace(DIRECTORY_SEPARATOR, '/', $folder) . '/' . $relative_path;
         if (file_exists($path)) {
             if ($relative) {
                 $parts = explode('/storage/', $path);
                 $storage_path = array_pop($parts);
                 return self::$location['real_root_folder'] . '/storage/' . $storage_path;
             }
             return $path;
         }
     }
     return false;
 }