I want to access the createUrl () function of Yii from inside the model.
This is my code in my afterSave ().
public function afterSave(){ ...more code... $message = "Hi ".$this->firstname.' '.$this->lastname.',\n Welcome to XYZ. This is the mail that is sent for the activation of your account.\n Kindly click this link or copy paste it to the URL and register your account.'.$this->createUrl('/user/activate',array('id'=>$this->id,'key'=>$randomKey)); ...morecode... }
This is the line that needs to be fixed.
$ this-> createUrl ('/ user / Activate', array ('ID' => $ this-> ID, 'key' => $ use random))
Obviously this gives me an error. So how can I use the createUrl () function from the model?
Hi,
source share