|
Prismic.io PHP kit
3.0.0
|
Public Member Functions | |
| resolve ($link) | |
| __invoke ($link) | |
| resolveDocument ($document) | |
| resolveLink ($link) | |
| isBookmarkDocument ($api, $document, $bookmark) | |
| isBookmark ($api, $link, $bookmark) | |
The LinkResolver convert prismic.io's links into your application's ones. Since prismic.io can't possibly know how to resolve internal links into usable ones for your application, you have to teach it! That way, you can pass this knowledge as a LinkResolver object into any operation that may have to resolve URLs (such as calling asHtml() on StructuredText or Link fragments).
If you're using a starter project, it usually comes with a basic linkResolver object, located at a relevant place, and made available everywhere in your application.
Read the last paragraph of prismic.io's API documentation to better understand the idea.
| Prismic\LinkResolver::__invoke | ( | $link | ) |
What happens when the link resolver gets called.
| DocumentLink | $link | The document link |
| Prismic\LinkResolver::isBookmark | ( | $api, | |
| $link, | |||
| $bookmark | |||
| ) |
Returns true if the given document link corresponds to the given bookmark
| API | $api | The API |
| DocumentLink | $link | The document link to test |
| string | $bookmark | The bookmark to test |
| Prismic\LinkResolver::isBookmarkDocument | ( | $api, | |
| $document, | |||
| $bookmark | |||
| ) |
Returns true if the given document corresponds to the given bookmark
| API | $api | The API |
| Document | $document | The document to test |
| string | $bookmark | The bookmark to test |
|
abstract |
Returns the application-specific URL related to this document link, or null if the link is deemed invalid
| DocumentLink | $link | The document link |
| Prismic\LinkResolver::resolveDocument | ( | $document | ) |
| Prismic\LinkResolver::resolveLink | ( | $link | ) |
Returns the application-specific URL related to this document link
| DocumentLink | $link | The document link |
1.8.12