I have a working blog but I thought a bit late about nice urls.
I dont want to use slugable and so on bundles because I dont have much time to read documentations and implement them.
Is it possible to reach a field of an entity and generate the slug from that before doctrine executes into the db?
I thought of an easy solution in the entity like:
public function __construct() {
$this->setPostedAt(new \DateTime());
$this->setSlug();
}
public function setSlug(){
$tmpslug = (string)$this->id."-";
$tmpslug .= $this->slugify($this->title);
$this->slug = $tmpslug;
}
However this will not work as the id and title fields are empty when the construct() called.
Is there any fast solution which wouldnt require to implement a new extension?
Thanks!