stofdoctrineextensions

Generating doctrine slugs manually

邮差的信 提交于 2019-12-01 21:38:30
I'm using sluggable behavior in my Symfony2 project, but now I would like to make many slugs for one page, based on different texts (current title, old title(s), users text from form input), and keep it in another table. And my question is - how to manually use doctrine extensions for any text? I can't find it anywhere. Perfect would be something like: /* careful - it's not a real, working code! */ $sluggable = new DoctrineSluggable(); $slug = $sluggable->generate('My own text!'); echo $slug; // my-own-text Radzikowski I found solution by accident here . Code: use Gedmo\Sluggable\Util as