Prismic.io PHP kit  3.0.0
Public Member Functions | List of all members
Prismic\Fragment\Link\LinkInterface Interface Reference
Inheritance diagram for Prismic\Fragment\Link\LinkInterface:
Prismic\Fragment\FragmentInterface Prismic\Fragment\Link\DocumentLink Prismic\Fragment\Link\FileLink Prismic\Fragment\Link\WebLink Prismic\Fragment\Link\ImageLink

Public Member Functions

 getUrl ($linkResolver=null)
 
- Public Member Functions inherited from Prismic\Fragment\FragmentInterface
 asText ()
 
 asHtml ($linkResolver)
 

Detailed Description

This interface embodies any link. 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).

Its known implementations are DocumentLink, WebLink, and also FileLink and ImageLink (united as "MediaLink" in former versions of the kit).

Member Function Documentation

§ getUrl()

Prismic\Fragment\Link\LinkInterface::getUrl (   $linkResolver = null)

Returns the URL we're linking to. The linkResolver will be needed in case the link is a document link. Read more about the link resolver at the very end of prismic.io's documentation.

Parameters
\Prismic\LinkResolver$linkResolverthe link resolver (read prismic.io's API documentation to learn more)
Returns
string the URL of the resource we're linking to online

Implemented in Prismic\Fragment\Link\DocumentLink, Prismic\Fragment\Link\FileLink, and Prismic\Fragment\Link\WebLink.


The documentation for this interface was generated from the following file: