示例#1
0
 protected function onInitialize()
 {
     parent::onInitialize();
     $this->selection = $this->getModelObject();
     $this->group = new RadioGroup('choice', new PropertyModel($this, 'selection'));
     $this->add($this->group);
     //@todo add the type hint b/ack into the closure when the serializer can handle them
     $this->group->add(new ListView('choices', function (&$item) {
         $radio = new \picon\Radio('radio', $item->getModel());
         $item->add($radio);
         $item->add(new \picon\FormComponentLabel('label', $radio));
     }, new ArrayModel($this->getChoices())));
 }
示例#2
0
 protected function onComponentTag(ComponentTag $tag)
 {
     $this->checkComponentTag($tag, 'select');
     $tag->setTagType(new XmlTagType(XmlTagType::OPEN));
     parent::onComponentTag($tag);
 }