Search code examples
phpsymfonyslug

Symfony 2 Slug null


I've got a problem with doctrine bundle.

Here's my code :

config.yml

stof_doctrine_extensions:
orm:
    default:
        sluggable: true

AppKernel

new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),

Entity :

/**
 * @var string
 *
 * @ORM\Column(name="name", type="string", length=255)
 */
private $name;
/**
 * @Gedmo\Slug(fields={"name"})
 * @ORM\Column(length=128, unique=true)
 */
 private $slugurl;

I already put the use statement.

But when I want to save I've got this message :

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'slugurl' cannot be null

Thx for your help !


Solution

  • Wrong config file. app/config.yml it's app/config/config.yml. My bad!