Showing alert in controller

Hi mans, i wanna show an alert when i try delete a ‘person’ and that ‘person’ have ‘childrens’ 1:n relation with on delete no action, i tried:


echo "<script>alert('message');</script>";

but this doesn’t give me any signal of life hehe, any solution? Thanks

You should use the CClientScript function:

public CClientScript registerScript(string $id, string $script, integer $position=4)

http://www.yiiframework.com/doc/api/1.1/CClientScript#registerScript-detail

Thanks for your answer, but i dont know how to use :S:S, can write for me and example? Thanks