Код: Выделить всё
- id(primary key)
- title
- url
Пробовал сделать вторую часть в afterSave() модели
Код: Выделить всё
public function afterSave($insert, $changedAttributes)
{
$url = $this->id . "-";
$url .= $this->createLatinUrl($this->title);
$this->url = $url;
if (!isset($changedAttributes["url"])) {
$this->save();
}
}
Какое придумать условие, чтобы избежать рекурсии? Или как по другому решить?