2017-04-26 5 views
1

Ich bin PHP noob!Wie von HTML_QuickForm zu HTML_QuickForm2 migriert werden

Ich mache Version sehr altes PHP-System zu PHP5.

Es verwendet viele Birne API.

Das ist alte Quelle

$form = new HTML_QuickForm("commonForm", "POST", "controller.php"); 
$form->addElement("text", "empNo", "UserNo", array("autocomplete" => "off")); 
$form->addElement("password", "empPass", "Password"); 
$form->display(); 

Und das Ergebnis

enter image description here

Also ich meine Quelle mit diesem Link geändert. http://pear.php.net/manual/en/package.html.html-quickform2.qf-migration.php

Und das ist meine neue Quelle.

$form = new HTML_QuickForm2("commonForm", "POST", "controller.php"); 
$form->addElement("text", "empNo", array("autocomplete" => "off")) 
->setLabel('UserNo'); 
$form->addElement("password", "empPass") 
->setLabel('Password'); 

echo $form; 

Dies ist Ergebnis

enter image description here

ich alte Version machen wollen.

Kann ich etwas lernen?

Vielen Dank.

Antwort

Verwandte Themen