You are here

public function FacetApiPrettyPathsCoderTaxonomy::encodePathSegment in Facet API Pretty Paths 7

Same name and namespace in other branches
  1. 6.3 plugins/coders/facetapi_pretty_paths_coder_taxonomy.inc \FacetApiPrettyPathsCoderTaxonomy::encodePathSegment()

Taxonomy special case: <alias>/<term-name>-<term-id>

Overrides FacetApiPrettyPathsCoderDefault::encodePathSegment

See also

FacetApiPrettyPathsCoderDefault::encodePathSegment()

File

plugins/coders/facetapi_pretty_paths_coder_taxonomy.inc, line 18
A taxonomy specific coder for pretty paths.

Class

FacetApiPrettyPathsCoderTaxonomy
Taxonomy specific implementation of FacetApiPrettyPathsCoder.

Code

public function encodePathSegment(array $args) {
  if ($term = taxonomy_term_load($args['segment']['value'])) {
    $args['segment']['value'] = $this
      ->prettyPath($term->name) . '-' . $term->tid;
  }
  return parent::encodePathSegment($args);
}