PHP Classes
elePHPant
Icontem

File: examples/form.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Michele Brodoloni  >  PHP Dialog  >  examples/form.php  >  Download  
File: examples/form.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Dialog
Create console based UIs with the dialog program
Author: By
Last change: Added phpdoc-style comments to source code (most of)
Added a README file with installation instructions
Made some fixes into main class code
Made some changes to the example scripts and checked if they work

Date: 3 years ago
Size: 577 bytes
 

Contents

Class file image Download
#!/usr/bin/php
<?php

require_once '../include/class.dialog.php';

$dialog = Dialog::factory('form');

$dialog->setFormHeight(20)
       ->
addField('Username', 1, 1, 'utente', 1, 12, 20, -1)
       ->
addField('Name', 2, 1, 'passwd', 2, 12, 20, 0)
       ->
addField('Surname', 3, 1, 'sysadmin', 3, 12, 20, 0)
       ->
addFields(array(
            array(
'Username', 4, 1, 'utente', 5, 1, 10, -1),
            array(
'Username', 6, 1, 'utente', 7, 1, 10, -1),
            array(
'Username', 8, 1, 'utente', 9, 1, 10, -1),
        ));

$res = $dialog->show();

echo
"Risultato: $res\n";
var_dump($res);

exit();