Gdn_Upload::url PHP Метод

url() публичный статический Метод

public static url ( $Name ) : mixed
$Name
Результат mixed
    public static function url($Name)
    {
        $Parsed = self::parse($Name);
        return $Parsed['Url'];
    }

Usage Example

Пример #1
0
 /**
  * Perform formatting against a string for the attach tag.
  *
  * @param Nbbc $bbcode Instance of Nbbc doing the parsing.
  * @param int $action Value of one of NBBC's defined constants.  Typically, this will be BBCODE_CHECK.
  * @param string $name Name of the tag.
  * @param string $default Value of the _default parameter, from the $params array.
  * @param array $params A standard set parameters related to the tag.
  * @param string $content Value between the open and close tags, if any.
  * @return string Formatted value.
  */
 public function doAttachment($bbcode, $action, $name, $default, $params, $content)
 {
     $medias = $this->media();
     $mediaID = $content;
     if (isset($medias[$mediaID])) {
         $media = $medias[$mediaID];
         $src = htmlspecialchars(Gdn_Upload::url(val('Path', $media)));
         $name = htmlspecialchars(val('Name', $media));
         if (val('ImageWidth', $media)) {
             return "<div class=\"Attachment Image\"><img src=\"{$src}\" alt=\"{$name}\" /></div>";
         } else {
             return anchor($name, $src, 'Attachment File');
         }
     }
     return anchor(t('Attachment not found.'), '#', 'Attachment NotFound');
 }
All Usage Examples Of Gdn_Upload::url