Yii2 Slugable Behavior not working

Hello,

I have this code to enalbe the slugable behaviour to automaticly generate the slugs from the title

but it is not working

what should I do to make it work

in my PostController I have this




public function behaviors()

    {

        return [

            [

                'class' => SluggableBehavior::className(),

                'attribute' => 'title',

                // 'slugAttribute' => 'slug',

            ],

            'verbs' => [

                'class' => VerbFilter::className(),

                'actions' => [

                    'delete' => ['post'],

                ],

            ],

        ];

    }

Please help me to make it fixed

Thanks

http://www.yiiframework.com/doc-2.0/yii-behaviors-sluggablebehavior.html

SluggableBehavior should be attached to ActiveRecord classes.