class FacetApiPrettyPathsCoderTaxonomy in Facet API Pretty Paths 7
Same name and namespace in other branches
- 6.3 plugins/coders/facetapi_pretty_paths_coder_taxonomy.inc \FacetApiPrettyPathsCoderTaxonomy
Taxonomy specific implementation of FacetApiPrettyPathsCoder.
Hierarchy
Expanded class hierarchy of FacetApiPrettyPathsCoderTaxonomy
1 string reference to 'FacetApiPrettyPathsCoderTaxonomy'
- facetapi_pretty_paths_facetapi_pretty_paths_coders in ./
facetapi_pretty_paths.module - Implements hook_facetapi_pretty_paths_coders().
File
- plugins/
coders/ facetapi_pretty_paths_coder_taxonomy.inc, line 11 - A taxonomy specific coder for pretty paths.
View source
class FacetApiPrettyPathsCoderTaxonomy extends FacetApiPrettyPathsCoderDefault {
/**
* Taxonomy special case: <alias>/<term-name>-<term-id>
*
* @see FacetApiPrettyPathsCoderDefault::encodePathSegment()
*/
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);
}
/**
* Taxonomy special case: <alias>/<term-name>-<term-id>
*
* @see FacetApiPrettyPathsCoderDefault::decodePathSegmentValue()
*/
public function decodePathSegmentValue(array $args) {
$exploded = explode('-', $args['value']);
$args['value'] = array_pop($exploded);
return parent::decodePathSegmentValue($args);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FacetApiPrettyPathsCoderDefault:: |
public | function | Decode the alias part of a path segment in order to interpret it from a given pretty path. | |
FacetApiPrettyPathsCoderDefault:: |
protected | function | Convert a given text to a pretty path using pathauto, if available. | |
FacetApiPrettyPathsCoderTaxonomy:: |
public | function |
Taxonomy special case: <alias>/<term-name>-<term-id> Overrides FacetApiPrettyPathsCoderDefault:: |
|
FacetApiPrettyPathsCoderTaxonomy:: |
public | function |
Taxonomy special case: <alias>/<term-name>-<term-id> Overrides FacetApiPrettyPathsCoderDefault:: |