|
Prismic.io PHP kit
3.0.0
|
Public Member Functions | |
| __construct ($url, $kind, $size, $filename) | |
| asHtml ($linkResolver=null) | |
| asText () | |
| getUrl ($linkResolver=null) | |
| getKind () | |
| getSize () | |
| getFilename () | |
Static Public Member Functions | |
| static | parse ($json) |
This class embodies a file link; it is what is retrieved from the API when a link is created towards a non-image file. LinkInterface objects can be found in two occasions: as the "$link" variable of a HyperlinkSpan object (which happens when the link is a hyperlink in a StructuredText fragment), or the LinkInterface can also be its own fragment (e.g. for a "related" fragment, that links to a related document).
| Prismic\Fragment\Link\FileLink::__construct | ( | $url, | |
| $kind, | |||
| $size, | |||
| $filename | |||
| ) |
Constructs a file link.
| string | $url | the URL of the resource we're linking to |
| string | $kind | the kind of resource it is (document, image, ...) |
| string | $size | the size of the resource, in bytes |
| string | $filename | the resource's original filename, in bytes |
| Prismic\Fragment\Link\FileLink::asHtml | ( | $linkResolver = null | ) |
Builds an HTML version of the raw link, pointing to the right URL, and with the resource's filename as the hypertext.
| \Prismic\LinkResolver | $linkResolver | the link resolver |
Implements Prismic\Fragment\FragmentInterface.
| Prismic\Fragment\Link\FileLink::asText | ( | ) |
Builds an unformatted text version of the raw link: simply, the URL.
Implements Prismic\Fragment\FragmentInterface.
| Prismic\Fragment\Link\FileLink::getFilename | ( | ) |
Returns the resource's original filename, in bytes
| Prismic\Fragment\Link\FileLink::getKind | ( | ) |
Returns the kind of resource it is (document, image, ...)
| Prismic\Fragment\Link\FileLink::getSize | ( | ) |
Returns the size of the resource, in bytes
| Prismic\Fragment\Link\FileLink::getUrl | ( | $linkResolver = null | ) |
Returns the URL of the resource we're linking to
| \Prismic\LinkResolver | $linkResolver | the link resolver (read prismic.io's API documentation to learn more) |
Implements Prismic\Fragment\Link\LinkInterface.
|
static |
1.8.12