Last active
August 29, 2015 14:22
-
-
Save prismicdeveloper/d3d5509994802edb0dc8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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