The Sluggable behavior saves the slug of one field in another one.
array(
'Model\Article' => array(
'fields' => array(
'title' => 'string',
'content' => 'string',
),
'extensions' => array(
array('class' => 'Mandango\Behavior\Sluggable', 'options' => array('fromField' => 'title')),
),
),
);
Hint
Options:
$article = $mandango->create('Model\Article')
->setTitle('Mandango is ultrafast!')
->save()
;
echo $article->getSlug(); // mandango-is-ultrafast
$article2 = $mandango->create('Model\Article')
->setTitle('Mandango is ultrafast!')
->save()
;
echo $article2->getSlug(); // mandango-is-ultrafast-2