Posted By

iroybot on 12/02/10


Tagged

php xml Framework zendframework


Versions (?)

Example XML Form Abstraction of a Zend_Form object


 / Published in: XML
 

an example on how to build xml of a Zend_Form for XSLT use

  1. <item type="form" id="searchform">
  2. <fragment id="method">post</fragment>
  3. <fragment id="id">searchform</fragment>
  4. <fragment id="state">init</fragment>
  5. <fragment id="enctype">application/x-www-form-urlencoded</fragment>
  6. <group id="fields">
  7. <item id="term" type="text">
  8. <fragment id="name">term</fragment>
  9. <fragment id="label">Your Search</fragment>
  10. <fragment id="value"/><fragment id="required">1</fragment>
  11. <fragment id="required">1</fragment>
  12. <fragment id="maxlength"/>
  13. <fragment id="size"/>
  14. <fragment id="readonly"/>
  15. <fragment id="description"/>
  16. </item>
  17. <item id="submit" type="submit">
  18. <fragment id="name">submit</fragment>
  19. <fragment id="label">Submit</fragment>
  20. <fragment id="value"/>
  21. <fragment id="required"/>
  22. <fragment id="required"/>
  23. <fragment id="maxlength"/>
  24. <fragment id="size"/>
  25. <fragment id="readonly"/>
  26. <fragment id="description"/>
  27. </item>
  28. </group>
  29. </item>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: iroybot on January 19, 2011

basic form representation in XML. in case isPost() the $POST array gets passed to the ZendForm object with isValid(), right after that a custom getXML() method transforms the Zend_Form object into the above XML fragment.

You need to login to post a comment.