Krang::URL - adjusting Krang object URLs to their publishing context
use Krang::ClassLoader 'URL';
# get the real URL for a story
my $story_url = pkg('URL')->real_url(object => $story, publisher => $publisher);
Krang::URL provides one method to adjust the URL of certain objects to
the current publishing context (preview or publish). When publishing
to preview, real_url() also checks the PreviewSSL config flag to
determine the URL's scheme (http or https).
Objects passed to real_url() are expected to have two methods:
Per default, you may pass to real_url() objects of class
Krang::Story, Krang::Media, Krang::Category and
Krang::Site.
real_url(object => $object, publisher => $publisher)Returns the empty string if $object is not an object.
Croaks if $object does not have both methods url() and preview_url()