You are here

public function AuthcacheP13nDefaultRequestRouter::generateURL in Authenticated User Page Caching (Authcache) 7.2

Given a request id and an optional argument, return the appropriate URL.

Parameters

String $route_id: The identifier of a request (e.g., frag/form-token).

Return value

String|FALSE An URL which can be used to call back to the request with the given argument.

Overrides AuthcacheP13nRequestRouterInterface::generateURL

File

modules/authcache_p13n/includes/AuthcacheP13nDefaultRequestRouter.inc, line 44
Defines the interface for mapping URLs to requests and vice versa.

Class

AuthcacheP13nDefaultRequestRouter
Interface for mapping URLs to requests and vice versa.

Code

public function generateURL($route_id, $arg = NULL) {
  $generator = $this
    ->getUrlGeneratorStore()
    ->getOne($route_id);
  if ($generator) {
    return $generator
      ->url($route_id, $arg);
  }
  else {
    watchdog('AuthcacheP13nDefaultRequestRouter', 'Failed to find url generator for route %r', array(
      '%r' => $route_id,
    ), WATCHDOG_ERROR);
    return FALSE;
  }
}