0
在action.class.php:如何重構這個symfony代碼?
$form = new NewsForm();
$form->setWidget('thumbnail', new sfWidgetFormSelect(array('choices' => $news['images'])));
$form->getWidget('summarize')->setDefault($news['summarize']);
$form->getWidget('title')->setDefault($news['title']);
凡在前面的步驟中生成$news
;
它看起來多餘,如何重構它?