Re: Re: QuickForm_Controller: get value filed from previous page
| From: | Ignatius Reilly | Date: | Thu, 10 Jun 2004 13:31:03 +0000 |
| Subject: | Re: Re: QuickForm_Controller: get value filed from previous page | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13077@lists.php.net to get a copy of this message | ||
Right. Belong to the faq
My usual code snippet:
$wizard =& new HTML_QuickForm_Controller( 'create_account' ) ;
$GLOBALS['container'] =& $wizard->container() ;
easier to make $container global from the beginning.
Ignatius
_________________________
"Reynald Borer" <reynald.borer@epfl.ch> wrote in message
news:40C85F3B.5080508@epfl.ch...
> Ok thanks for your help, I didn't saw that it was on the FAQ too.
>
> But the faq is not correct, it says to instantiate container like the
> following:
> $data =& $page->controller->container();
>
> And it works with the following line:
> $data =& $page->container();
>
> And my 2cent tip: in the Class for the page, inside the buildForm()
> function, don't forget to add "global $data" ;-)
>
> ||I'll send a message to pear-doc mailing-list to ask them to correct
> the faq.
>
> Reynald
>
> Ignatius Reilly wrote:
>
> >After instantiating the controller object, instantiate a container.
> >Values of previous pages are stored in the container.
> >
> >Ignatius
> >_________________________
> >"Reynald Borer" <reynald.borer@epfl.ch> wrote in message
> >news:40C84B5B.2030200@epfl.ch...
> >
> >
> >>Hi,
> >>
> >>I'm currently using QuickForm_Controller to build a 3 pages registration
> >>form. What I would like to know is if it's possible to get one value
> >>filled in a previous page to do some check on the current page. Example:
> >>on page 1 you must choose wether you're a member or not, and on page 2 I
> >>display a table that list some prices, and the prices differs when
> >>you're member or not. What I would like to do is highlight the price
> >>corresponding to the state of the submitter (that is, wether or not he
> >>is a member). Is it clear enough ? Basically I just want to take the
> >>content of the previous form and I don't know how to do that.
> >>
> >>Thanks in advance for your answer, and keep going on, PEAR packages are
> >>really great.
> >>
> >>Reynald
> >>
> >>--
> >>CRAFT
> >>Centre de Recherche et d'Appui pour la Formation et ses Technologies
> >>Center for Research and Support of Training and its Technologies
> >>
> >>Swiss Federal Institute of Technology Lausanne
> >>Ecole Polytechnique Fédérale de Lausanne (EPFL)
> >>
> >>CH-1015 Lausanne Switzerland
> >>Téléphone: +41 (0)21 693 25 89
> >>Fax: +41 (0)21 693 60 70
> >>reynald.borer@epfl.ch
> >>
> >>
> >
> >
> >
>
>
> --
> CRAFT
> Centre de Recherche et d'Appui pour la Formation et ses Technologies
> Center for Research and Support of Training and its Technologies
>
> Swiss Federal Institute of Technology Lausanne
> Ecole Polytechnique Fédérale de Lausanne (EPFL)
>
> CH-1015 Lausanne Switzerland
> Téléphone: +41 (0)21 693 25 89
> Fax: +41 (0)21 693 60 70
> reynald.borer@epfl.ch