[Yii Framework] 创建widget
class MyWidget extends CWidget
{
public function init()
{
// this method is called by CController::beginWidget()
}
public function run()
{
// this method is called by CController::endWidget()
}
}
通常,widget的视图是是放在components/views里面的,通过CWidget::render()来传递参数的