I guess I need to qualify this before I start showing what I've done by pointing out that I made a start on the patT before the wonderful helpfiles we currently have here were available so, like aw above I had to come up with my own approach. Yes I know I could go back and re-do what's already been done, but I've not finished templating the whole app so I'm reluctant to go back and re-hash what I've already done and lose my place, and frankly I don't yet see a need for it.
I decided to go for simplicity over everything else because at the end of the day I want my clients to be able to edit the templates, and it's not fair to expect them to be joomla experts to let them do it.
The following is an excerpt from some gateway processing files I'm currently working on:
$output['GATEWAY']=$plugin;
$output['COM_MR_DISPGUEST_CCARDISS']=jr_gettext('_COM_MR_DISPGUEST_CCARDISS',_COM_MR_DISPGUEST_CCARDISS,$language);
$iss_mon = mosHTML::integerSelectList( 01, 12, 1, 'iss_mon', 'size="1" class="inputbox"', 0, "%02d" );
$iss_year = mosHTML::integerSelectList( 2005, 2020, 1, 'iss_year', 'size="1" class="inputbox"', 0, "%02d" );
$output['CCARD_ISSUED']=$iss_mon.$iss_year;
$pageoutput[]=$output;
$tmpl = &new patTemplate();
$tmpl->setRoot( $gatewayPath );
$tmpl->readTemplatesFromInput( 'interrupt_outgoing.tmpl' );
$tmpl->addRows( 'interrupt_outgoing', $pageoutput );
$tmpl->displayParsedTemplate();
Of course, the above isn't all of it, but it does demonstrate how really really easy this stuff is. Unlike aw I haven't figured out how the condition stuff works and that's probably not a bad thing because it's making me keep the decisions in the code, rather than in the pt stuff. On the downside I have a booking form that calls a number of different templates from several different functions, which means that the form elements can only be displayed in the order that they're called. Sometime soon I'd like to figure out how to return each of the seperate template objects and call them all from within one main template file. It's probably ridiculously easy, but it's not top of the priority list ATM so it can wait a couple of weeks before I attack it.
_________________
http://www.jomres.net THE online hotel booking and reservation system for Joomla