'Blog', ); /** * {@inheritdoc} */ public function getCMSFields() { $this->beforeUpdateCMSFields(function ($fields) { $fields->push(DropdownField::create('BlogID', _t('BlogTagsWidget.Blog', 'Blog'), Blog::get()->map())); }); return parent::getCMSFields(); } /** * @return array */ public function getTags() { $blog = $this->Blog(); if($blog) { return $blog->Tags(); } return array(); } } class BlogTagsWidget_Controller extends Widget_Controller { }