You are here

function getdirections_location_id_path in Get Directions 7.2

Same name and namespace in other branches
  1. 6.2 getdirections.api.inc \getdirections_location_id_path()
  2. 7.3 getdirections.api.inc \getdirections_location_id_path()

API Function to generate a url path for use by other modules/themes.

Example Usage: $path = getdirections_location_id_path('to', $lid); $url = l(t('Get directions'), $path);

Parameters

string $direction: Required. The direction the supplied input applies to. Must be either 'to' or 'from'

int $lid: Required. The lid (location id) of the location, as found in the location table

Return value

Returns a path relative to the drupal root.

File

./getdirections.api.inc, line 217
Get directions API

Code

function getdirections_location_id_path($direction, $lid) {
  if (getdirections_get_current_supported_module() && is_numeric($lid) && ($direction == 'to' || $direction == 'from')) {
    return "getdirections/location_id/{$direction}/{$lid}";
  }
}