|
Prismic.io PHP kit
3.0.0
|
Public Member Functions | |
| __construct ($url, $maybeContentType=null) | |
| asHtml ($linkResolver=null) | |
| asText () | |
| getUrl ($linkResolver=null) | |
| getContentType () | |
Static Public Member Functions | |
| static | parse ($json) |
This class embodies a web link; it is what is retrieved from the API when a link is created towards a media 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\WebLink::__construct | ( | $url, | |
$maybeContentType = null |
|||
| ) |
Constructs a media link.
| string | $url | the URL of the resource we're linking to online |
| string | $maybeContentType | the content type, if known |
| Prismic\Fragment\Link\WebLink::asHtml | ( | $linkResolver = null | ) |
Builds an HTML version of the raw link, pointing to the right URL, and with the resource's URL as the hypertext.
| \Prismic\LinkResolver | $linkResolver | the link resolver |
Implements Prismic\Fragment\FragmentInterface.
| Prismic\Fragment\Link\WebLink::asText | ( | ) |
Builds an unformatted text version of the raw link: simply, the URL.
Implements Prismic\Fragment\FragmentInterface.
| Prismic\Fragment\Link\WebLink::getContentType | ( | ) |
Returns the content type, if known
| Prismic\Fragment\Link\WebLink::getUrl | ( | $linkResolver = null | ) |
Returns the URL of the resource we're linking to online
| \Prismic\LinkResolver | $linkResolver | the link resolver (read prismic.io's API documentation to learn more) |
Implements Prismic\Fragment\Link\LinkInterface.
|
static |
1.8.12