<?php
//in the protected/components/mywidget
class MyWidget extends CWidget{
public function init(){
//do initializing...
}
public function run(){
//render or echoing something...
}
}
?>
//in the view.php
...
<?php $this->widget(\'application.components.mywidget.MyWidget\'); ?>
...