示例#1
0
 public function testFieldsetLayoutWithTextInput()
 {
     $text = new FormKit\Widget\TextInput('name');
     $layout = new FormKit\Layout\FieldsetLayout('Information');
     $layout->addWidget($text);
     $html = $layout->render();
     // select_ok( 'fieldset legend' ,1 , $html);
     // select_ok( 'fieldset label' ,1 , $html);
 }
示例#2
0
$countries = new FormKit\Widget\SelectInput('country', array('label' => 'Country', 'options' => array('Test' => 'Test', 'Asia' => array('Taiwan', 'Taipei', 'Tainan', 'Tokyo', 'Korea'))));
$color = new FormKit\Widget\ColorInput('color', array('label' => _('Color')));
$radio = new FormKit\Widget\RadioInput('type', array('label' => 'Size', 'value' => 'Two', 'options' => array('One', 'Two', 'Three')));
$size = new FormKit\Widget\SelectInput('size', array('label' => 'Size', 'options' => array('1' => 'foo', '2' => 'bar', '3' => 'zxx', 4 => 'zzz')));
$layout->addWidget($size);
$submit = new FormKit\Widget\SubmitInput();
$layout->addWidget($imageInput)->addWidget($countries)->cellpadding(6)->cellspacing(6)->border(0);
$layout->addWidget($color);
$layout->addWidget($ajaxComplete);
$layout->addWidget($radio);
$layout->addWidget($file);
$layout->addWidget($canvas);
$layout->addWidget($textarea);
$layout->addWidget($submit);
$form = new FormKit\Element\Form();
$form->method('post')->action('?');
$form->addChild($layout);
echo $form->render();
?>

<h2>FieldsetLayout Demo</h2>
<?php 
$layout = new FormKit\Layout\FieldsetLayout('Legend text');
$layout->addWidget($text);
$layout->addWidget($textarea);
$layout->addChild($submit);
echo $layout->render();
?>
</body>
</html>