RE: [phplib] OOHForms & Templates? From: Rogers, Paul (Paul.Rogers <email protected>)
Date: 06/20/01

Philipe

Thanks for your reply. I am trying to, as you suggest, to seperate the lay
out from the code that "does all the work". I like OOHForms but there seems
to be no provision for lay out. You've given me some ideas so I'll go away
and have aplay with it.

Thanks again

Paul

-----Original Message-----
From: Philippe Paravicini [mailto:quietsky <email protected>]
Sent: 18 June 2001 17:57
To: Rogers, Paul; 'phplib'
Subject: RE: [phplib] OOHForms & Templates?

Personally, I don't use templates as I don't mind the occasional <?php print
$var ?> in my html.

I put all my form setup in one file (someform.setup) and all my html in
another (someform.ihtml), and include them as appropriate. Using Templates
results in a similar structure.

The form setup file contains all the database queries needed to retrieve the
data that I need for that page (drop-down options, 'thawed' data, etc...),
and all the oohform 'add_element' statements, plus the post-submit
javascript validation.

The html contains the <?php $frm_someform->show_element("anInput") ?>
statements, and 'for' and 'while' loops if necessary, but no other php
logic.

I use phpshop 0.6.1 (www.phpshop.org) as a framework (which at one point
used phplib, and then 'borrowed' heavily from it, and now I think intends to
go back to phplib), which basically has one main 'index.php' page which
processes the form and then includes the corresponding page.

In this manner, the form setup page contains the definition of the oohform
and retrieves all the data needed to display it, the html page contains the
presentation of the page with no logic other than simple loops, and the
logic is all contained in objects and modules, as the phpshop framework
defines them.

I would say that the accepted general idea is to separate presentation from
logic, so that you don't end up with a bunch of interspersed html and php
which makes the code difficult to read to a php programmer, and impossible
to decipher to an html programmer with no php experience.

I hope this helps

Philippe Paravicini
eCommerce Developer

-----Original Message-----
From: Rogers, Paul [mailto:Paul.Rogers <email protected>]
Sent: Monday, June 18, 2001 12:36 AM
To: 'phplib'
Subject: [phplib] OOHForms & Templates?

Dear All

What's the best way to lay out a form using OOHForms?

Should I mix the php code with HTML or is there a more elegant approach, say
using templates?

I'd be grateful for any views on this.

Paul

PS When the "out of office assistant" is on here can any one let me know if
they receive auto responses to messages sent to me via the list. I think
I've filtered you guys out, but I'm not sure. I guess I'd have received
lots of irate responses, but maybe you're all too polite :-)

****************************************************************************
*
This email and any attachments transmitted with it are confidential
and intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the sender and do not store, copy or disclose the content
to any other person.

It is the responsibility of the recipient to ensure that opening this
message and/or any of its attachments will not adversely affect
its systems. No responsibility is accepted by the Company.
****************************************************************************
*

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>

*****************************************************************************
This email and any attachments transmitted with it are confidential
and intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the sender and do not store, copy or disclose the content
to any other person.

It is the responsibility of the recipient to ensure that opening this
message and/or any of its attachments will not adversely affect
its systems. No responsibility is accepted by the Company.
*****************************************************************************