Which Solution ? Events Or Something Else

i want my system support future manipulation for data extracted for front end.

like googleplus plugins or facebook,or rating which add some extra html , … to output content , this addons added latter as widgets or sth else

for know my field data is just content but i want system support future addons which change this data

i have one solution to create class of CEvent and add $content property and pass it onBeforeRender for front end




MyEvent Extend CEvent

{

public $content;

}



before render text




$this->onBeforeRender(new MyEvent($this));



in plugin set something like it




$controller::OnBeforeRender=function($event){

//change $event->content and add html like faccebook like or star rating 

}



i dont know , is it the best solution or is there Better Solution

is there anybody to answer my question?