Symfony2 : StofDoctrineExtensionsBundle - Installation
1 - Composer :
"require": {
"stof/doctrine-extensions-bundle": "dev-master"
}
2- Registration in app/AppKernel.php :
public function registerBundles()
{
return array(
// …
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
// …
);
}
3 - Activating the Extention in config.yml :
stof_doctrine_extensions:
default_locale: en_US
orm:
default:
sluggable: true
timestampable: true # not needed: listeners are not enabled by default
4 - Using it :
namespace Sdz\BlogBundle\Entity;
namespace Savewall\CrawlBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
class Article
{
// …
/**
* @Gedmo\Slug(fields={"title"})
* @ORM\Column(length=128, unique=true)
*/
private $slug;
}
Voila
Written by Bull7ya
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Extensions
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#