Пример #1
0
 /**
  * @param PrototypesInterface $form
  */
 public function buildPrototypes(PrototypesInterface $form)
 {
     // define email inpu
     $form->defineInput('email')->setRequired()->addFilter(Filter::TRIM)->addFilter(Filter::FORCE_TRAILING, '.nl')->setConverter(Converter::SERIALIZE);
     // define email field
     $form->defineField('fldEmail')->useInput('email');
     // define test aggregator
     $form->defineField('fldHobbies')->addAggregator('hobbies')->setConverter(Converter::SERIALIZE)->addInput('hobby1')->next()->addInput('hobby2')->next()->addInput('hobby3');
     $form->defineContent('testCallbackContent')->setContentCallback(array($this, 'getTestContent'));
 }
Пример #2
0
 /**
  * @param PrototypesInterface $form
  */
 public function buildPrototypes(PrototypesInterface $form)
 {
     $form->defineFieldset(Types::FIELDSET_PERSONALIA);
     $form->defineField(Types::FIELD_NAME);
     $form->defineInput(Types::INPUT_TEXT);
     $form->defineInput(Types::INPUT_EMAIL)->setConverter(Converter::SERIALIZE);
     $form->defineField(Types::FIELD_QUESTION);
     $form->defineTextarea(Types::TEXTAREA_QUESTION)->cols()->rows();
     $form->defineInput('address')->setInputType(InputType::PASSWORD);
 }
Пример #3
0
 /**
  * @param PrototypesInterface $prototypes
  */
 public function buildPrototypes(PrototypesInterface $prototypes)
 {
     // manipulate container base prototypes
     $this->buildFormPrototype($prototypes->getFormPrototype());
     $this->buildContainerPrototype($prototypes->getContainerPrototype());
     $this->buildFieldsetPrototype($prototypes->getFieldsetPrototype());
     $this->buildFieldPrototype($prototypes->getFieldPrototype());
     $this->buildRowPrototype($prototypes->getRowPrototype());
     $this->buildAggregatorPrototype($prototypes->getAggregatorPrototype());
     // manipulate control base prototypes
     $this->buildInputPrototype($prototypes->getInputPrototype());
     $this->buildCheckboxPrototype($prototypes->getCheckboxPrototype());
     $this->buildSelectPrototype($prototypes->getSelectPrototype());
     $this->buildTextareaPrototype($prototypes->getTextareaPrototype());
     $this->buildButtonPrototype($prototypes->getButtonPrototype());
     // manipulate content base prototypes
     $this->buildContentPrototype($prototypes->getContentPrototype());
     $this->buildLabelPrototype($prototypes->getLabelPrototype());
     $this->buildHtmlPrototype($prototypes->getHtmlPrototype());
     $this->buildHtmlTagPrototype($prototypes->getHtmlTagPrototype());
     $this->buildViewPrototype($prototypes->getViewPrototype());
 }
Пример #4
0
 /**
  * @param PrototypesInterface $form
  */
 public function buildPrototypes(PrototypesInterface $form)
 {
     // define the field 'name'
     $form->defineField('fldName')->addInput('firstname')->addFilter(Filter::LOWERCASE)->addValidator(Validator::EQUALS, 'yo')->ifCondition(Condition::CURRENT_VALUE, Validator::EQUALS, 'yo')->setHtmlAttribute('style', 'background-color:red;')->addValidator(Validator::EQUALS, 'peter')->endCondition()->next()->addInput('lastname')->next()->ifCondition(Condition::FIELD_VALUE, 'firstname', Validator::STARTS_WITH, 'm')->addSelect('gender')->next()->endCondition()->addInput('jaja')->setValue('jaja');
 }
Пример #5
0
 /**
  * @param PrototypesInterface $prototypes
  */
 public function buildPrototypes(PrototypesInterface $prototypes)
 {
     $prototypes->defineSelect('selecter');
     $prototypes->defineFieldset('test1234')->addInput('testInput')->next()->useSelect('selecter', 'aapje');
 }