示例#1
0
 public function form()
 {
     $username = new Input\Text('lace-admin-username');
     $username->setLabel('Username:'******'lace-admin-password');
     $password->setLabel('Password:'******'submit', 'SUBMIT');
     $this->form->addElements([$username, $password, $submit]);
     return $this->form;
 }
 public function form()
 {
     $country_name = new Input\Text('lace-zone-name');
     $country_name->setLabel('Zone Name:')->setRequired(true)->addValidator(new Validator\Alpha());
     $country_zone_code = new Input\Text('lace-zone-code');
     $country_zone_code->setLabel('ISO Code 3:')->setRequired(true)->setAttribute('maxlength', '3')->addValidators([new Validator\Alpha(), new Validator\Length(3)]);
     $enabled = new Input\Checkbox('lace-enabled', '1');
     $enabled->setLabel('Enable:');
     $submit = new Input\Submit('submit', 'SUBMIT');
     //Adding Elements to form
     $this->form->addElements([$country_name, $country_zone_code, $enabled, $submit]);
     return $this->form;
 }
 public function form()
 {
     $country_name = new Input\Text('lace-country-name');
     $country_name->setLabel('Country Name:')->setRequired(true)->addValidator(new Validator\Alpha());
     $country_iso_3 = new Input\Text('lace-country-iso3');
     $country_iso_3->setLabel('ISO Code 3:')->setRequired(true)->setAttribute('maxlength', '3')->addValidators([new Validator\Alpha(), new Validator\Length(3)]);
     $country_iso_2 = new Input\Text('lace-country-iso2');
     $country_iso_2->setLabel('ISO Code 2:')->setRequired(true)->setAttribute('maxlength', '2')->addValidators([new Validator\Alpha(), new Validator\Length(2)]);
     $postcode_required = new Input\Checkbox('lace-postcode', '1');
     $postcode_required->setLabel('Post Code Required:');
     $enabled = new Input\Checkbox('lace-enabled', '1');
     $enabled->setLabel('Enable:');
     $submit = new Input\Submit('submit', 'SUBMIT');
     //Adding Elements to form
     $this->form->addElements([$country_name, $country_iso_3, $country_iso_2, $postcode_required, $enabled, $submit]);
     return $this->form;
 }
示例#4
0
 /**
  * Render the child and its child nodes
  *
  * @param  boolean $ret
  * @param  int     $depth
  * @param  string  $indent
  * @param  string  $errorIndent
  * @return mixed
  */
 public function render($ret = false, $depth = 0, $indent = null, $errorIndent = null)
 {
     $datalist = parent::render(true, $depth, $indent) . $this->datalist->render(true, $depth, $indent);
     // Return or print the rendered child node output.
     if ($ret) {
         return $datalist;
     } else {
         echo $datalist;
     }
 }