Пример #1
0
$radioButtons->addOption('Waz', 'WAZ');
$vbox->packStart($radioButtons);
//$file = new FileEntry('archivo');
//$vbox->packStart($file);
$b = new Button('b1', 'Send', STOCK_CANCEL);
$b->addEvent(new JSEvent(ON_CLICK, 'this.form.submit()'));
$vbox->packStart($b);
$form = new Form($_SERVER['PHP_SELF'], 'post');
$form->add($vbox);
$form->show();
if (count($_POST) > 1) {
    $data = array();
    $i = 0;
    foreach ($_POST as $k => $v) {
        $data[$i]['name'] = $k;
        if (is_array($v)) {
            $data[$i]['value'] = implode('<br />', $v);
        } else {
            $data[$i]['value'] = $v;
        }
        $i++;
    }
    $grid = new DataGrid($data, 'Widgets/Values');
    $grid->addColumn(new Column('Widget', 'name'));
    $grid->addColumn(new Column('Value', 'value'));
    $grid->show();
}
?>
</body>
</html>