Example #1
0
 public static function get_url($src, $type, $name)
 {
     try {
         $domain = \System\Settings::get('resources', 'domain');
     } catch (\System\Error\Config $e) {
         $domain = null;
     }
     $map = self::get_map();
     $post = null;
     if (isset($map[$type])) {
         $cname = $map[$type];
         if ($cname::POSTFIX_OUTPUT) {
             $post = $cname::POSTFIX_OUTPUT;
         }
     }
     if (!$post && strpos($name, '.')) {
         $name = explode('.', $name);
         $post = '.' . array_pop($name);
         $name = implode('.', $name);
     }
     $name = $name . '.' . self::get_serial() . ($post ? $post : '');
     $path = \System\Router::get_first_url('system_resource', array($src, $type, $name));
     if ($domain) {
         $path = '//' . $domain . $path;
     }
     return $path;
 }