PHPackages                             activelamp/taxonomy-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. activelamp/taxonomy-bundle

ActiveLibrary

activelamp/taxonomy-bundle
==========================

Create vocabularies and terms with this bundle.

2202[1 issues](https://github.com/activelamp/taxonomy-bundle/issues)PHP

Since May 22Pushed 11y ago1 watchersCompare

[ Source](https://github.com/activelamp/taxonomy-bundle)[ Packagist](https://packagist.org/packages/activelamp/taxonomy-bundle)[ RSS](/packages/activelamp-taxonomy-bundle/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (2)Used By (0)

TaxonomyBundle [![Build Status](https://camo.githubusercontent.com/96ec639cfe40caa88b2e9ae6bb4f0eb8870eb787f1e318faa19fb6753ed61566/68747470733a2f2f7472617669732d63692e6f72672f6163746976656c616d702f7461786f6e6f6d792d62756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/activelamp/taxonomy-bundle)
============================================================================================================================================================================================================================================================================================================================

[](#taxonomybundle-)

\#Usage

Steps:

- Add `activelamp/taxonomy-bundle` as a dependency to your project.
- Register the bundle:

```
   $bundles = array(
       ...
       new ActiveLAMP\TaxonomyBundle\ALTaxonomyBundle(),
   );
```

- Update your database schema (i.e., run `php app/console doctrine:schema:update --force`)
- Add the following lines to your `app/config/routing.yml` file to expose the back-end administration for taxonomies and terms:

```
al_taxonomy:
    resource: "@ALTaxonomyBundle/Resources/routing.yml"
    prefix : /manage-taxonomies #This can be whatever you want.
```

\#Entity set-up

You have to set-up your entities before you can start using them with taxonomies. This is done by adding a few annotations to the entity class and the properties you want to use taxonomies with. The annotations you are going to be using resides in the `\ActiveLAMP\TaxonomyBundle\Annotations` namespace.

1. Declare that your entity is a termed entity by tagging it with the `@Entity` annotation.
2. Mark the properties which are going to be using vocabulary terms with the `@Vocabulary` annotation.
3. Stub the vocabulary fields when necessary (more on this in the example below.):

```
