Skip to content

Instantly share code, notes, and snippets.

@prismicdeveloper
Last active August 29, 2015 14:22
Show Gist options
  • Save prismicdeveloper/d3d5509994802edb0dc8 to your computer and use it in GitHub Desktop.
Save prismicdeveloper/d3d5509994802edb0dc8 to your computer and use it in GitHub Desktop.
class StarterKitLinkResolver extends LinkResolver
{
// [...]
public function resolve($link)
{
// [...]
if ($link->getType() == 'author') {
return '/author/'.$link->getId().'/'.$link->getSlug();
}
if ($link->getType() == 'category') {
return '/category/'.$link->getUid();
}
// ---- Start of the code to add ----
if ($link->getType() == 'event') {
return '/event/'.$link->getUid();
}
// ---- End of the code to add ----
// [...]
}
// [...]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment