5 * A taxonomy specific coder for pretty paths.
9 * Taxonomy specific implementation of FacetApiPrettyPathsCoder.
11 class FacetApiPrettyPathsCoderTaxonomy
extends FacetApiPrettyPathsCoderDefault
{
14 * Taxonomy special case: <alias>/<term-name>-<term-id>
16 * @see FacetApiPrettyPathsCoderDefault::encodePathSegment()
18 public
function encodePathSegment(array $args) {
19 if ($term = taxonomy_term_load($args['segment']['value'])) {
20 $args['segment']['value'] = $this->prettyPath($term->name
) .
'-' .
$term->tid
;
22 return parent
::encodePathSegment($args);
26 * Taxonomy special case: <alias>/<term-name>-<term-id>
28 * @see FacetApiPrettyPathsCoderDefault::decodePathSegmentValue()
30 public
function decodePathSegmentValue(array $args) {
31 $exploded = explode('-', $args['value']);
32 $args['value'] = array_pop($exploded);
33 return parent
::decodePathSegmentValue($args);