コード例 #1
0
 protected function registerElements()
 {
     $this->action_mode = self::ACTION_GET;
     $this->setAction('refresh');
     $text = new Text();
     $text->init();
     $text->setTitle("Movie name");
     $text->setName("movieName");
     $this->addDisplayElement($text);
     $fieldset = new FieldSet();
     $fieldset->init();
     $fieldset->setTitle("Actor");
     $fieldset->setName("actor");
     $text = new Text();
     $text->init();
     $text->setTitle("Name");
     $text->setName("name");
     $fieldset->add($text);
     $text = new Text();
     $text->init();
     $text->setTitle("FDfsf");
     $text->setName("fof");
     $fieldset->add($text);
     $collection = new Collection();
     $collection->init();
     $collection->setTitle("Actors");
     $collection->setName('actors');
     $collection->add($fieldset);
     $this->addDisplayElement($collection);
     $submit = new \Controller\OWeb\Helpers\Form\Elements\Submit();
     $submit->init();
     $submit->setVal("Refresh");
     $this->addDisplayElement($submit);
 }
コード例 #2
0
ファイル: TabsForm.php プロジェクト: oliverde8/oweb-framework
 protected function registerElements()
 {
     $this->action_mode = self::ACTION_GET;
     $validatorBool = new \OWeb\utils\inputManagement\validators\Boolean();
     $jsString = new \OWeb\utils\inputManagement\validators\JsString();
     $this->setAction('refresh');
     $active = new \Controller\OWeb\Helpers\Form\Elements\Text();
     $active->init();
     $active->setName('active');
     $active->setTitle('Active');
     $active->setDescription("Which panel is currently open.");
     $active->addValidator(new \OWeb\utils\inputManagement\validators\Integer());
     $active->addValidator(new \OWeb\utils\inputManagement\validators\CanBeEmpty());
     $active->setVal(0);
     $this->addDisplayElement($active);
     $collapsible = new \Controller\OWeb\Helpers\Form\Elements\Radio();
     $collapsible->init();
     $collapsible->setName('collapsible');
     $collapsible->setTitle('Collapsible');
     $collapsible->add("true", "true");
     $collapsible->add("false", "false");
     $collapsible->addValidator($validatorBool);
     $collapsible->setVal('true');
     $collapsible->setDescription("hether all the sections can be closed at once. Allows collapsing the active section");
     $this->addDisplayElement($collapsible);
     $event = new \Controller\OWeb\Helpers\Form\Elements\Text();
     $event->init();
     $event->setName('event');
     $event->setTitle('Event');
     $event->setVal('click');
     $event->addValidator($jsString);
     $event->setDescription("The event that accordion headers will react to in order to activate the associated panel. Multiple events can be specified, separated by a space.");
     $this->addDisplayElement($event);
     $heightStyle = new \Controller\OWeb\Helpers\Form\Elements\Select();
     $heightStyle->init();
     $heightStyle->setName('heightStyle');
     $heightStyle->setTitle('Height Style');
     $heightStyle->add("Auto", "auto");
     $heightStyle->add("Fill", "fill");
     $heightStyle->add("Content", "content");
     $heightStyle->addValidator($jsString);
     $heightStyle->setVal('content');
     $heightStyle->setDescription("Controls the height of the accordion and each panel.");
     $this->addDisplayElement($heightStyle);
     $submit = new \Controller\OWeb\Helpers\Form\Elements\Submit();
     $submit->init();
     $submit->setVal("Refresh");
     $this->addDisplayElement($submit);
 }