Nová stránka: Porovnání verzí

Z Wiki PedF UK
Přejít na: navigace, hledání
(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:
<html>
+
# Same as before
<body>
+
public function execute($par) {
 
+
        $this->setHeaders();
<form action="new_page.php" method="post">
+
Nová stránka: <input type="text" name="name"><br>
+
        # A formDescriptor Array to tell HTMLForm what to build
<input type="submit">
+
        $formDescriptor = array(
</form>
+
                        'simpletextfield' => array(
 
+
                                'label' => 'Simple Text Field', # What's the label of the field
</body>
+
                                'class' => 'HTMLTextField' # What's the input type
</html>
+
                        )
 +
        );
 +
 +
        $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

  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

}