Re: Re: Quickform Controller

From: Date: Tue, 14 Mar 2006 02:12:52 +0000
Subject: Re: Re: Quickform Controller
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23283@lists.php.net to get a copy of this message
>Timothy Marsolais wrote: > >> Warning: Cannot modify header information - headers already sent by (output started at >> /path/to/my/server/_lib/class.page.php:257) in >> /path/to/my/server/_pear/PEAR/HTML/QuickForm/Action/Jump.php on line 53 > >http://de2.php.net/manual/en/faq.using.php#faq.using.headers-sent > >> The class.page.php file is my own page class (simple, but it works), and line 257 is the following: >> >> echo "<html xmlns=\"http://www.w3.org/1999/xhtml\"»3� >> J ò×С”÷Áù xml:lang=\"en\" lang=\"en\">\n"; > >This 'echo' is used too early, i.e. before Jump.php sends the header. >Use it later in your script. > >HTH, >Mark > Yes--this is correct. How do get the Controller to run without outputting directly to the screen? The forms are going into a content area of my page--and, the headers have to come before the content area. If I move the wizard up before the page class runs, it obviously puts the form at the top of the page, and then displays the page. Is there a way to get the Controller object to run, but output to a variable that I can echo at the right place in the sequence of displaying the page? Here is the code on my page--and like I said, the Controller works fine. $wizard =& new HTML_QuickForm_Controller('newMemberWizard'); $page1 =& new MembershipType('membershipType'); $page2 =& new AssociateAccountInfo('associate'); $page3 =& new TowingAccountInfo('towing'); $page4 =& new PaymentType('paymentType'); $page5 =& new CheckInfo('check'); $page6 =& new CreditInfo('credit'); $page7 =& new Confirm('confirm'); $wizard->addPage($page1); $wizard->addPage($page2); $wizard->addPage($page3); $wizard->addPage($page4); $wizard->addPage($page5); $wizard->addPage($page6); $wizard->addPage($page7); $page1->addAction('next', new MembershipTypeActionNext()); $page2->addAction('next', new AccountInfoActionNext()); $page2->addAction('back', new AccountInfoActionBack()); $page3->addAction('next', new AccountInfoActionNext()); $page3->addAction('back', new AccountInfoActionBack()); $page4->addAction('next', new PaymentTypeActionNext()); $page4->addAction('back', new PaymentTypeActionBack()); $page5->addAction('next', new PaymentInfoActionNext()); $page5->addAction('back', new PaymentInfoActionBack()); $page6->addAction('next', new PaymentInfoActionNext()); $page6->addAction('back', new PaymentInfoActionBack()); $page7->addAction('back', new ConfirmActionBack()); $wizard->addAction('display', new ActionDisplay()); $wizard->addAction('process', new ActionProcess()); // my own page class // each of these functions are collections of echo statements // that build the pages $memPage = new SitePage(); $memPage->setTitle($title); $memPage->setContent($content); $memPage->DisplayHeader(); $memPage->DisplayContentBegin(); $wizard->run(); $memPage->DisplayContent(); $memPage->DisplayContentEnd(); $memPage->DisplayFooter(); $memPage->DisplayNavigation(); $memPage->DisplayPageEnd(); Thanks for your help, in advance. -Tim --------------------------------------- * Timothy Marsolais * * http://www.Technology-Works.Net * * 916.996.6542 * * Build Projects that Matter * ---------------------------------------

« previous php.pear.general (#23283) next »