Provides a slugger which can generate a slug from a string and event listeners to auto-generate slugs on chosen fields
- See the require section in the composer.json
This bundle can be installed following these steps:
$ php composer.phar require integrated/slug-bundle:~0.3
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Integrated\Bundle\SlugBundle\IntegratedSlugBundle()
// ...
);
}
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Integrated\Bundle\SlugBundle\Mapping\Annotations\Slug;
class Article
{
/**
* @var string
* @ODM\String
*/
protected $title;
/**
* @var string
* @ODM\String
* @Slug(fields={"title"})
*/
protected $slug;
...
}
@Slug(fields={"title", "anotherField"})
@Slug(fields={"title"}, seperator="_")
@Slug(fields={"getSlug"})
This bundle is under the MIT license. See the complete license in the bundle:
LICENSE
Pull requests are welcome. Please see our CONTRIBUTING guide.
This bundle is part of the Integrated project. You can read more about this project on the Integrated for developers website.