SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    QuickForm: Possible to collect the form html in a string?

    Hi,
    I have started using quickForm and I found that the $form->display() method sends the output directly to the browser.
    It doesn't suit me, because I have a base Box class, a decorBox and tabbedBox classes to wrap content through their setter methods and then place it on the pages calling the box instances getter methods. Furthermore, if I want to write in the header div of a page,for instance, again I want to do something like: $pageInstance->adToHeader($someContent), which also requires to store the form html in a variable.

    $myBoxInstance->addContent($formInstance->display()); does not write to the already existing content.
    Is there any other method I can use to get the html string of the form?
    Thanks.

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $myBoxInstance->addContent($formInstance->toHTML()); 
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there a comprehensive quickform tutorial/reference?

    Thanks a lot!!
    Really, I was following the quick form intro in the PHP Anthology- very clear but incomplete- then I went to the official website, finally I tried to search for 'QuickForm methods' without being able to find a comprehensive list of all the existing methods.
    Ah, yes, before I forget, I also searched sitepoint php forums before posting a message only to see that a lot of people struggle with trivial problems that come from the differences in the latest release and so on.
    Is there a comprehensive tutorial worth reading and using as a reference about quickform?

  4. #4
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I've never used it.

    I found the method at http://pear.php.net/package/HTML_Qui...QuickForm.html

    The methods to the object are on the right - the toHTML() method stood out when looking for something which returned the HTML.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •