On Mon, 2 Jul 2001, grep wrote:

>       You have your perl code, you are outputting to more than
>       one medium - hence you have more than one template. You
>       also have a big chunk of presentation logic that is applicable
>       to all presentation mediums (i.e. all templates)- where do
>       you stick this presentation logic?

As I said on channel (answer repeated here for posterity.)  You use a
VIEW.  VIEWs are collections of templates that can be referred to as a
whole.  Thus I can switch my whole look by using the template stored in
$a rather than the one stored in $b [1].

For example, with my tt & xpath stuff I have three sections.

 - The xml file that has the data in it.  This data is organised in some
   arbitrary format that may or may not have anything to do with the order
   it's displayed in.

 - The template file that pulls out the data with XPath.  This template
   file may make use of several plug-ins that contain the application
   logic, uses IF and other stuctures, etc., etc.  The template file
   actually then outputs the code using:

 - A self recursing view to render the xml into some particular format
   (e.g. various forms of html, wap, etc)  You have multiple views
   enabling you to have multiple outputs.

That's the concept, anyway.

Later.

Mark.

[1] well, actually the one stored in the template stash as 'a' rather than
the one stored in the template stash as 'b', but you get the idea.

-- 
s''  Mark Fowler                                     London.pm   Bath.pm
     http://www.twoshortplanks.com/              [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}


Reply via email to