Skip to content

Extension points

phil/taxonomy-bundle

What an application configures, replaces or relies on. Resources are phil/resource references, and slugs are phil/slug's.

Configuration

OptionWhat it extends
sluggerThe service id of the slugger that makes tag slugs and category keys: a named slugger of phil/slug-bundle, phil_slug.slugger.tags, or a decorated one; null for the transliterating slugger
fallback_localeThe language of a category name when there is none in the language asked

See Tags and Categories.

The application's resources

Any resource is tagged or categorised by its reference — article, media.image, the kinds the application chooses — and taggedWith() reads them back by kind: the taxonomy knows nothing else of them. A bundle that tags its own resources, as phil/calendar-bundle does its events, picks a kind of its own.

TaxonomyRepository

Phil\TaxonomyBundle\Domain\Repository\TaxonomyRepository — tags, categories, translations and assignments, a public alias of DoctrineTaxonomyRepository. A store of the application's own keeps the batch methods — tags(), categoriesWithIds(), translationsOf() — reading many at once, and branchIds() the whole branch in one read, so that moves stay free of cycles without reading the tree node by node.

Services and forms

PointHow
TaxonomyInjected to find or create, rename, move and merge, and to tag resources
TagsTypeTags as text, separated by commas
CategoryTypeA category chosen from the tree
More than a field doesA form type extension of the application's on either type — see Forms