Zend_Form-Advanced.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.form.advanced">
  4. <title>Advanced Zend_Form Usage</title>
  5. <para>
  6. <classname>Zend_Form</classname> has a wealth of functionality, much of it aimed
  7. at experienced developers. This chapter aims to document some of this
  8. functionality with examples and use cases.
  9. </para>
  10. <sect2 id="zend.form.advanced.arrayNotation">
  11. <title>Array Notation</title>
  12. <para>
  13. Many experienced web developers like to group related form elements
  14. using array notation in the element names. For example, if you have
  15. two addresses you wish to capture, a shipping and a billing address,
  16. you may have identical elements; by grouping them in an array, you
  17. can ensure they are captured separately. Take the following form,
  18. for example:
  19. </para>
  20. <programlisting language="html"><![CDATA[
  21. <form>
  22. <fieldset>
  23. <legend>Shipping Address</legend>
  24. <dl>
  25. <dt><label for="recipient">Ship to:</label></dt>
  26. <dd><input name="recipient" type="text" value="" /></dd>
  27. <dt><label for="address">Address:</label></dt>
  28. <dd><input name="address" type="text" value="" /></dd>
  29. <dt><label for="municipality">City:</label></dt>
  30. <dd><input name="municipality" type="text" value="" /></dd>
  31. <dt><label for="province">State:</label></dt>
  32. <dd><input name="province" type="text" value="" /></dd>
  33. <dt><label for="postal">Postal Code:</label></dt>
  34. <dd><input name="postal" type="text" value="" /></dd>
  35. </dl>
  36. </fieldset>
  37. <fieldset>
  38. <legend>Billing Address</legend>
  39. <dl>
  40. <dt><label for="payer">Bill To:</label></dt>
  41. <dd><input name="payer" type="text" value="" /></dd>
  42. <dt><label for="address">Address:</label></dt>
  43. <dd><input name="address" type="text" value="" /></dd>
  44. <dt><label for="municipality">City:</label></dt>
  45. <dd><input name="municipality" type="text" value="" /></dd>
  46. <dt><label for="province">State:</label></dt>
  47. <dd><input name="province" type="text" value="" /></dd>
  48. <dt><label for="postal">Postal Code:</label></dt>
  49. <dd><input name="postal" type="text" value="" /></dd>
  50. </dl>
  51. </fieldset>
  52. <dl>
  53. <dt><label for="terms">I agree to the Terms of Service</label></dt>
  54. <dd><input name="terms" type="checkbox" value="" /></dd>
  55. <dt></dt>
  56. <dd><input name="save" type="submit" value="Save" /></dd>
  57. </dl>
  58. </form>
  59. ]]></programlisting>
  60. <para>
  61. In this example, the billing and shipping address contain some
  62. identical fields, which means one would overwrite the other. We can
  63. solve this solution using array notation:
  64. </para>
  65. <programlisting language="html"><![CDATA[
  66. <form>
  67. <fieldset>
  68. <legend>Shipping Address</legend>
  69. <dl>
  70. <dt><label for="shipping-recipient">Ship to:</label></dt>
  71. <dd><input name="shipping[recipient]" id="shipping-recipient"
  72. type="text" value="" /></dd>
  73. <dt><label for="shipping-address">Address:</label></dt>
  74. <dd><input name="shipping[address]" id="shipping-address"
  75. type="text" value="" /></dd>
  76. <dt><label for="shipping-municipality">City:</label></dt>
  77. <dd><input name="shipping[municipality]" id="shipping-municipality"
  78. type="text" value="" /></dd>
  79. <dt><label for="shipping-province">State:</label></dt>
  80. <dd><input name="shipping[province]" id="shipping-province"
  81. type="text" value="" /></dd>
  82. <dt><label for="shipping-postal">Postal Code:</label></dt>
  83. <dd><input name="shipping[postal]" id="shipping-postal"
  84. type="text" value="" /></dd>
  85. </dl>
  86. </fieldset>
  87. <fieldset>
  88. <legend>Billing Address</legend>
  89. <dl>
  90. <dt><label for="billing-payer">Bill To:</label></dt>
  91. <dd><input name="billing[payer]" id="billing-payer"
  92. type="text" value="" /></dd>
  93. <dt><label for="billing-address">Address:</label></dt>
  94. <dd><input name="billing[address]" id="billing-address"
  95. type="text" value="" /></dd>
  96. <dt><label for="billing-municipality">City:</label></dt>
  97. <dd><input name="billing[municipality]" id="billing-municipality"
  98. type="text" value="" /></dd>
  99. <dt><label for="billing-province">State:</label></dt>
  100. <dd><input name="billing[province]" id="billing-province"
  101. type="text" value="" /></dd>
  102. <dt><label for="billing-postal">Postal Code:</label></dt>
  103. <dd><input name="billing[postal]" id="billing-postal"
  104. type="text" value="" /></dd>
  105. </dl>
  106. </fieldset>
  107. <dl>
  108. <dt><label for="terms">I agree to the Terms of Service</label></dt>
  109. <dd><input name="terms" type="checkbox" value="" /></dd>
  110. <dt></dt>
  111. <dd><input name="save" type="submit" value="Save" /></dd>
  112. </dl>
  113. </form>
  114. ]]></programlisting>
  115. <para>
  116. In the above sample, we now get separate addresses. In the submitted
  117. form, we'll now have three elements, the 'save' element for the
  118. submit, and then two arrays, 'shipping' and 'billing', each with
  119. keys for their various elements.
  120. </para>
  121. <para>
  122. <classname>Zend_Form</classname> attempts to automate this process with its
  123. <link linkend="zend.form.forms.subforms">sub forms</link>. By
  124. default, sub forms render using the array notation as shown in the
  125. previous HTML form listing, complete with ids. The array name is
  126. based on the sub form name, with the keys based on the elements
  127. contained in the sub form. Sub forms may be nested arbitrarily deep,
  128. and this will create nested arrays to reflect the structure.
  129. Additionally, the various validation routines in
  130. <classname>Zend_Form</classname> honor the array structure, ensuring that your
  131. form validates correctly, no matter how arbitrarily deep you nest
  132. your sub forms. You need do nothing to benefit from this; this
  133. behaviour is enabled by default.
  134. </para>
  135. <para>
  136. Additionally, there are facilities that allow you to turn on array
  137. notation conditionally, as well as specify the specific array to
  138. which an element or collection belongs:
  139. </para>
  140. <itemizedlist>
  141. <listitem>
  142. <para>
  143. <classname>Zend_Form::setIsArray($flag)</classname>: By setting the
  144. flag true, you can indicate that an entire form should be
  145. treated as an array. By default, the form's name will be
  146. used as the name of the array, unless
  147. <code>setElementsBelongTo()</code> has been called. If the
  148. form has no specified name, or if
  149. <code>setElementsBelongTo()</code> has not been set, this
  150. flag will be ignored (as there is no array name to which
  151. the elements may belong).
  152. </para>
  153. <para>
  154. You may determine if a form is being treated as an array
  155. using the <code>isArray()</code> accessor.
  156. </para>
  157. </listitem>
  158. <listitem><para>
  159. <classname>Zend_Form::setElementsBelongTo($array)</classname>:
  160. Using this method, you can specify the name of an array to
  161. which all elements of the form belong. You can determine the
  162. name using the <code>getElementsBelongTo()</code> accessor.
  163. </para></listitem>
  164. </itemizedlist>
  165. <para>
  166. Additionally, on the element level, you can specify individual
  167. elements may belong to particular arrays using
  168. <classname>Zend_Form_Element::setBelongsTo()</classname> method.
  169. To discover what this value is -- whether set explicitly or
  170. implicitly via the form -- you may use the
  171. <code>getBelongsTo()</code> accessor.
  172. </para>
  173. </sect2>
  174. <sect2 id="zend.form.advanced.multiPage">
  175. <title>Multi-Page Forms</title>
  176. <para>
  177. Currently, Multi-Page forms are not officially supported in
  178. <classname>Zend_Form</classname>; however, most support for implementing them
  179. is available and can be utilized with a little extra tooling.
  180. </para>
  181. <para>
  182. The key to creating a multi-page form is to utilize sub forms, but
  183. to display only one such sub form per page. This allows you to
  184. submit a single sub form at a time and validate it, but not process
  185. the form until all sub forms are complete.
  186. </para>
  187. <example id="zend.form.advanced.multiPage.registration">
  188. <title>Registration Form Example</title>
  189. <para>
  190. Let's use a registration form as an example. For our purposes,
  191. we want to capture the desired username and password on the
  192. first page, then the user's metadata -- given name, family name,
  193. and location -- and finally allow them to decide what mailing
  194. lists, if any, they wish to subscribe to.
  195. </para>
  196. <para>
  197. First, let's create our own form, and define several sub forms
  198. within it:
  199. </para>
  200. <programlisting language="php"><![CDATA[
  201. class My_Form_Registration extends Zend_Form
  202. {
  203. public function init()
  204. {
  205. // Create user sub form: username and password
  206. $user = new Zend_Form_SubForm();
  207. $user->addElements(array(
  208. new Zend_Form_Element_Text('username', array(
  209. 'required' => true,
  210. 'label' => 'Username:',
  211. 'filters' => array('StringTrim', 'StringToLower'),
  212. 'validators' => array(
  213. 'Alnum',
  214. array('Regex',
  215. false,
  216. array('/^[a-z][a-z0-9]{2,}$/'))
  217. )
  218. )),
  219. new Zend_Form_Element_Password('password', array(
  220. 'required' => true,
  221. 'label' => 'Password:',
  222. 'filters' => array('StringTrim'),
  223. 'validators' => array(
  224. 'NotEmpty',
  225. array('StringLength', false, array(6))
  226. )
  227. )),
  228. ));
  229. // Create demographics sub form: given name, family name, and
  230. // location
  231. $demog = new Zend_Form_SubForm();
  232. $demog->addElements(array(
  233. new Zend_Form_Element_Text('givenName', array(
  234. 'required' => true,
  235. 'label' => 'Given (First) Name:',
  236. 'filters' => array('StringTrim'),
  237. 'validators' => array(
  238. array('Regex',
  239. false,
  240. array('/^[a-z][a-z0-9., \'-]{2,}$/i'))
  241. )
  242. )),
  243. new Zend_Form_Element_Text('familyName', array(
  244. 'required' => true,
  245. 'label' => 'Family (Last) Name:',
  246. 'filters' => array('StringTrim'),
  247. 'validators' => array(
  248. array('Regex',
  249. false,
  250. array('/^[a-z][a-z0-9., \'-]{2,}$/i'))
  251. )
  252. )),
  253. new Zend_Form_Element_Text('location', array(
  254. 'required' => true,
  255. 'label' => 'Your Location:',
  256. 'filters' => array('StringTrim'),
  257. 'validators' => array(
  258. array('StringLength', false, array(2))
  259. )
  260. )),
  261. ));
  262. // Create mailing lists sub form
  263. $listOptions = array(
  264. 'none' => 'No lists, please',
  265. 'fw-general' => 'Zend Framework General List',
  266. 'fw-mvc' => 'Zend Framework MVC List',
  267. 'fw-auth' => 'Zend Framwork Authentication and ACL List',
  268. 'fw-services' => 'Zend Framework Web Services List',
  269. );
  270. $lists = new Zend_Form_SubForm();
  271. $lists->addElements(array(
  272. new Zend_Form_Element_MultiCheckbox('subscriptions', array(
  273. 'label' =>
  274. 'Which lists would you like to subscribe to?',
  275. 'multiOptions' => $listOptions,
  276. 'required' => true,
  277. 'filters' => array('StringTrim'),
  278. 'validators' => array(
  279. array('InArray',
  280. false,
  281. array(array_keys($listOptions)))
  282. )
  283. )),
  284. ));
  285. // Attach sub forms to main form
  286. $this->addSubForms(array(
  287. 'user' => $user,
  288. 'demog' => $demog,
  289. 'lists' => $lists
  290. ));
  291. }
  292. }
  293. ]]></programlisting>
  294. <para>
  295. Note that there are no submit buttons, and that we have done
  296. nothing with the sub form decorators -- which means that by
  297. default they will be displayed as fieldsets. We will need to be
  298. able to override these as we display each individual sub form,
  299. and add in submit buttons so we can actually process them --
  300. which will also require action and method properties. Let's add
  301. some scaffolding to our class to provide that information:
  302. </para>
  303. <programlisting language="php"><![CDATA[
  304. class My_Form_Registration extends Zend_Form
  305. {
  306. // ...
  307. /**
  308. * Prepare a sub form for display
  309. *
  310. * @param string|Zend_Form_SubForm $spec
  311. * @return Zend_Form_SubForm
  312. */
  313. public function prepareSubForm($spec)
  314. {
  315. if (is_string($spec)) {
  316. $subForm = $this->{$spec};
  317. } elseif ($spec instanceof Zend_Form_SubForm) {
  318. $subForm = $spec;
  319. } else {
  320. throw new Exception('Invalid argument passed to ' .
  321. __FUNCTION__ . '()');
  322. }
  323. $this->setSubFormDecorators($subForm)
  324. ->addSubmitButton($subForm)
  325. ->addSubFormActions($subForm);
  326. return $subForm;
  327. }
  328. /**
  329. * Add form decorators to an individual sub form
  330. *
  331. * @param Zend_Form_SubForm $subForm
  332. * @return My_Form_Registration
  333. */
  334. public function setSubFormDecorators(Zend_Form_SubForm $subForm)
  335. {
  336. $subForm->setDecorators(array(
  337. 'FormElements',
  338. array('HtmlTag', array('tag' => 'dl',
  339. 'class' => 'zend_form')),
  340. 'Form',
  341. ));
  342. return $this;
  343. }
  344. /**
  345. * Add a submit button to an individual sub form
  346. *
  347. * @param Zend_Form_SubForm $subForm
  348. * @return My_Form_Registration
  349. */
  350. public function addSubmitButton(Zend_Form_SubForm $subForm)
  351. {
  352. $subForm->addElement(new Zend_Form_Element_Submit(
  353. 'save',
  354. array(
  355. 'label' => 'Save and continue',
  356. 'required' => false,
  357. 'ignore' => true,
  358. )
  359. ));
  360. return $this;
  361. }
  362. /**
  363. * Add action and method to sub form
  364. *
  365. * @param Zend_Form_SubForm $subForm
  366. * @return My_Form_Registration
  367. */
  368. public function addSubFormActions(Zend_Form_SubForm $subForm)
  369. {
  370. $subForm->setAction('/registration/process')
  371. ->setMethod('post');
  372. return $this;
  373. }
  374. }
  375. ]]></programlisting>
  376. <para>
  377. Next, we need to add some scaffolding in our action controller,
  378. and have several considerations. First, we need to make sure we
  379. persist form data between requests, so that we can determine
  380. when to quit. Second, we need some logic to determine what form
  381. segments have already been submitted, and what sub form to
  382. display based on that information. We'll use
  383. <classname>Zend_Session_Namespace</classname> to persist data, which will
  384. also help us answer the question of which form to submit.
  385. </para>
  386. <para>
  387. Let's create our controller, and add a method for retrieving a
  388. form instance:
  389. </para>
  390. <programlisting language="php"><![CDATA[
  391. class RegistrationController extends Zend_Controller_Action
  392. {
  393. protected $_form;
  394. public function getForm()
  395. {
  396. if (null === $this->_form) {
  397. $this->_form = new My_Form_Registration();
  398. }
  399. return $this->_form;
  400. }
  401. }
  402. ]]></programlisting>
  403. <para>
  404. Now, let's add some functionality for determining which form to
  405. display. Basically, until the entire form is considered valid,
  406. we need to continue displaying form segments. Additionally, we
  407. likely want to make sure they're in a particular order: user,
  408. demog, and then lists. We can determine what data has been
  409. submitted by checking our session namespace for particular keys
  410. representing each subform.
  411. </para>
  412. <programlisting language="php"><![CDATA[
  413. class RegistrationController extends Zend_Controller_Action
  414. {
  415. // ...
  416. protected $_namespace = 'RegistrationController';
  417. protected $_session;
  418. /**
  419. * Get the session namespace we're using
  420. *
  421. * @return Zend_Session_Namespace
  422. */
  423. public function getSessionNamespace()
  424. {
  425. if (null === $this->_session) {
  426. $this->_session =
  427. new Zend_Session_Namespace($this->_namespace);
  428. }
  429. return $this->_session;
  430. }
  431. /**
  432. * Get a list of forms already stored in the session
  433. *
  434. * @return array
  435. */
  436. public function getStoredForms()
  437. {
  438. $stored = array();
  439. foreach ($this->getSessionNamespace() as $key => $value) {
  440. $stored[] = $key;
  441. }
  442. return $stored;
  443. }
  444. /**
  445. * Get list of all subforms available
  446. *
  447. * @return array
  448. */
  449. public function getPotentialForms()
  450. {
  451. return array_keys($this->getForm()->getSubForms());
  452. }
  453. /**
  454. * What sub form was submitted?
  455. *
  456. * @return false|Zend_Form_SubForm
  457. */
  458. public function getCurrentSubForm()
  459. {
  460. $request = $this->getRequest();
  461. if (!$request->isPost()) {
  462. return false;
  463. }
  464. foreach ($this->getPotentialForms() as $name) {
  465. if ($data = $request->getPost($name, false)) {
  466. if (is_array($data)) {
  467. return $this->getForm()->getSubForm($name);
  468. break;
  469. }
  470. }
  471. }
  472. return false;
  473. }
  474. /**
  475. * Get the next sub form to display
  476. *
  477. * @return Zend_Form_SubForm|false
  478. */
  479. public function getNextSubForm()
  480. {
  481. $storedForms = $this->getStoredForms();
  482. $potentialForms = $this->getPotentialForms();
  483. foreach ($potentialForms as $name) {
  484. if (!in_array($name, $storedForms)) {
  485. return $this->getForm()->getSubForm($name);
  486. }
  487. }
  488. return false;
  489. }
  490. }
  491. ]]></programlisting>
  492. <para>
  493. The above methods allow us to use notations such as "<code>$subForm =
  494. $this-&gt;getCurrentSubForm();</code>" to retrieve the current
  495. sub form for validation, or "<code>$next =
  496. $this-&gt;getNextSubForm();</code>" to get the next one to
  497. display.
  498. </para>
  499. <para>
  500. Now, let's figure out how to process and display the various sub
  501. forms. We can use <code>getCurrentSubForm()</code> to determine
  502. if any sub forms have been submitted (false return values
  503. indicate none have been displayed or submitted), and
  504. <code>getNextSubForm()</code> to retrieve a form to display. We
  505. can then use the form's <code>prepareSubForm()</code> method to
  506. ensure the form is ready for display.
  507. </para>
  508. <para>
  509. When we have a form submission, we can validate the sub form,
  510. and then check to see if the entire form is now valid. To do
  511. these tasks, we'll need additional methods that ensure that
  512. submitted data is added to the session, and that when validating
  513. the form entire, we validate against all segments from the
  514. session:
  515. </para>
  516. <programlisting language="php"><![CDATA[
  517. class RegistrationController extends Zend_Controller_Action
  518. {
  519. // ...
  520. /**
  521. * Is the sub form valid?
  522. *
  523. * @param Zend_Form_SubForm $subForm
  524. * @param array $data
  525. * @return bool
  526. */
  527. public function subFormIsValid(Zend_Form_SubForm $subForm,
  528. array $data)
  529. {
  530. $name = $subForm->getName();
  531. if ($subForm->isValid($data)) {
  532. $this->getSessionNamespace()->$name = $subForm->getValues();
  533. return true;
  534. }
  535. return false;
  536. }
  537. /**
  538. * Is the full form valid?
  539. *
  540. * @return bool
  541. */
  542. public function formIsValid()
  543. {
  544. $data = array();
  545. foreach ($this->getSessionNamespace() as $key => $info) {
  546. $data[$key] = $info;
  547. }
  548. return $this->getForm()->isValid($data);
  549. }
  550. }
  551. ]]></programlisting>
  552. <para>
  553. Now that we have the legwork out of the way, let's build the
  554. actions for this controller. We'll need a landing page for the
  555. form, and then a 'process' action for processing the form.
  556. </para>
  557. <programlisting language="php"><![CDATA[
  558. class RegistrationController extends Zend_Controller_Action
  559. {
  560. // ...
  561. public function indexAction()
  562. {
  563. // Either re-display the current page, or grab the "next"
  564. // (first) sub form
  565. if (!$form = $this->getCurrentSubForm()) {
  566. $form = $this->getNextSubForm();
  567. }
  568. $this->view->form = $this->getForm()->prepareSubForm($form);
  569. }
  570. public function processAction()
  571. {
  572. if (!$form = $this->getCurrentSubForm()) {
  573. return $this->_forward('index');
  574. }
  575. if (!$this->subFormIsValid($form,
  576. $this->getRequest()->getPost())) {
  577. $this->view->form = $this->getForm()->prepareSubForm($form);
  578. return $this->render('index');
  579. }
  580. if (!$this->formIsValid()) {
  581. $form = $this->getNextSubForm();
  582. $this->view->form = $this->getForm()->prepareSubForm($form);
  583. return $this->render('index');
  584. }
  585. // Valid form!
  586. // Render information in a verification page
  587. $this->view->info = $this->getSessionNamespace();
  588. $this->render('verification');
  589. }
  590. }
  591. ]]></programlisting>
  592. <para>
  593. As you'll notice, the actual code for processing the form is
  594. relatively simple. We check to see if we have a current sub form
  595. submission, and if not, we go back to the landing page. If we do
  596. have a sub form, we attempt to validate it, redisplaying it if
  597. it fails. If the sub form is valid, we then check to see if the
  598. form is valid, which would indicate we're done; if not, we
  599. display the next form segment. Finally, we display a
  600. verification page with the contents of the session.
  601. </para>
  602. <para>
  603. The view scripts are very simple:
  604. </para>
  605. <programlisting language="php"><![CDATA[
  606. <?php // registration/index.phtml ?>
  607. <h2>Registration</h2>
  608. <?php echo $this->form ?>
  609. <?php // registration/verification.phtml ?>
  610. <h2>Thank you for registering!</h2>
  611. <p>
  612. Here is the information you provided:
  613. </p>
  614. <?
  615. // Have to do this construct due to how items are stored in session
  616. // namespaces
  617. foreach ($this->info as $info):
  618. foreach ($info as $form => $data): ?>
  619. <h4><?php echo ucfirst($form) ?>:</h4>
  620. <dl>
  621. <?php foreach ($data as $key => $value): ?>
  622. <dt><?php echo ucfirst($key) ?></dt>
  623. <?php if (is_array($value)):
  624. foreach ($value as $label => $val): ?>
  625. <dd><?php echo $val ?></dd>
  626. <?php endforeach;
  627. else: ?>
  628. <dd><?php echo $this->escape($value) ?></dd>
  629. <?php endif;
  630. endforeach; ?>
  631. </dl>
  632. <?php endforeach;
  633. endforeach ?>
  634. ]]></programlisting>
  635. <para>
  636. Upcoming releases of Zend Framework will include components to
  637. make multi page forms simpler by abstracting the session and
  638. ordering logic. In the meantime, the above example should serve
  639. as a reasonable guideline on how to accomplish this task for
  640. your site.
  641. </para>
  642. </example>
  643. </sect2>
  644. </sect1>
  645. <!--
  646. vim:se ts=4 sw=4 et:
  647. -->