Closed unprintedch closed 8 months ago
Hi @davouid ,
this library is not usually used on its own, therefore, this is not straight-forward :) You basically have three options here:
Here's an example for 2:
class NullLinkResolver implements \Contentful\Core\Api\LinkResolverInterface {
public function resolveLink(Link $link, array $parameters = []): \Contentful\Core\Resource\ResourceInterface
{
throw new \Exception("Found a link, but this class can not resolve links!");
}
public function resolveLinkCollection(array $links, array $parameters = []): array
{
throw new \Exception("Found a link, but this class can not resolve links!");
}
}
Great.
I'have tried 2, but still stuck. I must be over my head here. I had the idea that it would be easier to render this array to html with php. But in the end, I'm asking myself if it is not easier to parse the array on my own!
Thank you very much for you time.
Hello
I'm trying the get some nice html from the json i get from the graphql api using php. But i keep stuck with the "You will also need a link resolver to instanciate the parser." I have absolutely no idea how to get it. I there a way to have a full working example from the call to the render? Is what i'm trying even correct?