开发者

Auto update sluggable field with Doctrine

开发者 https://www.devze.com 2023-01-10 05:37 出处:网络
I\'m usin开发者_运维百科g CodeIgniter with Doctrine in a project. One of my models has the Sluggable behavior. The slug is created according to another field X when the object is saved. I was wonderin

I'm usin开发者_运维百科g CodeIgniter with Doctrine in a project. One of my models has the Sluggable behavior. The slug is created according to another field X when the object is saved. I was wondering if there was a way to automatically update this slug field when the X field is updated.

At the moment, if I update the X field, the slug field remains with the sluggable format of the old X field value.

Thanks in advance.


You can define "canUpdate" => true. So the slug gets updated every time you change the X field

0

精彩评论

暂无评论...
验证码 换一张
取 消