Nová stránka: Porovnání verzí
Z Wiki PedF UK
(Založena nová stránka s textem „<html> <body> <form action="new_page.php" method="post"> Nová stránka: <input type="text" name="name"><br> <input type="submit"> </form> </body> </html>“) |
|||
Řádka 1: | Řádka 1: | ||
− | + | # Same as before | |
− | + | public function execute($par) { | |
− | + | $this->setHeaders(); | |
− | + | ||
− | + | # A formDescriptor Array to tell HTMLForm what to build | |
− | + | $formDescriptor = array( | |
− | + | 'simpletextfield' => array( | |
− | + | 'label' => 'Simple Text Field', # What's the label of the field | |
− | + | 'class' => 'HTMLTextField' # What's the input type | |
− | + | ) | |
+ | ); | ||
+ | |||
+ | $htmlForm = new HTMLForm( $formDescriptor, $this->getContext() ); # We build the HTMLForm object | ||
+ | |||
+ | $htmlForm->setSubmitText( 'Allons-y gaiement' ); # What text does the submit button display | ||
+ | |||
+ | $htmlForm->show(); # Displaying the form | ||
+ | } |
Verze z 16. 11. 2014, 13:28
- Same as before
public function execute($par) {
$this->setHeaders(); # A formDescriptor Array to tell HTMLForm what to build $formDescriptor = array( 'simpletextfield' => array( 'label' => 'Simple Text Field', # What's the label of the field 'class' => 'HTMLTextField' # What's the input type ) ); $htmlForm = new HTMLForm( $formDescriptor, $this->getContext() ); # We build the HTMLForm object $htmlForm->setSubmitText( 'Allons-y gaiement' ); # What text does the submit button display $htmlForm->show(); # Displaying the form
}