Changes
Title
unchanged
Inline views, write less
Category
unchanged
Tips
Yii version
unchanged
Tags
unchanged
active record, URL, model, views
Content
changed
[...]
public function url($options=array(),$defaultView='view')
{
if($this->slug!=null)
return array($defaultView,array('slug'=>$this->slug),$options);
else
return
array($defaultView,array('id'=>$this->id),$options);
}
}
```